Skip to content

Instantly share code, notes, and snippets.

@Nicolab
Created July 22, 2014 09:37
Show Gist options
  • Save Nicolab/e967dfb457ffc4035656 to your computer and use it in GitHub Desktop.
Save Nicolab/e967dfb457ffc4035656 to your computer and use it in GitHub Desktop.
Webpack + Angular
gulp.task('angu.webpack', ['angu.assets-js-clean'], function() {
return gulp.src('main.js')
.pipe(webpack({
entry: {
main: paths.client + '/app/main/index.js',
user: paths.client + '/app/user/index.js'
// other entries ...
},
output: {
path: publicApp,
filename: '[name].js'
},
externals: {
// require("angular") is external and available
// on the global var angular
'angular': 'angular'
}
}))
.pipe(flow.ifEnv('production', uglify))
.pipe(gulp.dest(publicApp));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment