Skip to content

Instantly share code, notes, and snippets.

@MSakamaki
Created April 25, 2015 05:44
Show Gist options
  • Save MSakamaki/42584a8f8f63503c678b to your computer and use it in GitHub Desktop.
Save MSakamaki/42584a8f8f63503c678b to your computer and use it in GitHub Desktop.
grunt injector
injector: {
options: {
// Task-specific options go here.
},
scripts: {
options: {
transform: function(filePath) {
filePath = filePath.replace('/app/', '');
filePath = filePath.replace('/.tmp/', '');
return '<script src="' + filePath + '"></script>';
},
starttag: '<!-- injector:js -->',
endtag: '<!-- endinjector -->'
},
files: {
'app/index.html': [
['<%= config.app %>/{scripts,components}/**/*.js',
'!<%= config.app %>/scripts/main.js']
]
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment