I am using the concat grunt task:
concat: {
dist: {
src: [
'../assets/js/jquery.js',
'../assets/js/underscore.js',
'../assets/js/pusher.js',
'../assets/js/angular.js',
'../assets/js/angular-resource.js',
'../assets/js/angular-sanitize.js',
'../core/module.js',
'../core/**/*.js',
'src/js/**/*.js'
],
dest: 'dist/embed.js'
}
},
Eventually I get one script file that contains all the scripts in dist/embed.js.
I also have an html file in src/index.html.
I am looking for a way to inject all those script file when running development tasks and inject only dist/embed.js on production task. I am trying nor to write again all the scripts in the index.html, but I want to use the list of scripts from the concat task.
Does anyone have idea how to handle this?
I'll appreciate examples very much.
if (process.env.NODE_ENV == 'development')- adeneogrunt-env, which allows you to define environment variables for future tasks in the chain. - Paul Mougel