Skip to content

Instantly share code, notes, and snippets.

@bennovakovic
Created February 17, 2016 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennovakovic/963cdeef69433d650fda to your computer and use it in GitHub Desktop.
Save bennovakovic/963cdeef69433d650fda to your computer and use it in GitHub Desktop.
packing using gulp-sourcemaps
gulp.task('requirejsBuild', ['copyAndCompressRequirements'], function() {
return gulp.src('app/js/main.js')
.pipe(sourcemaps.init())
.pipe(requirejsOptimize({
mainConfigFile : 'app/js/main.js',
baseUrl: 'app/bower_components',
findNestedDependencies: true,
name: '../js/main',
optimize: 'uglify2',
preserveLicenseComments : false,
paths : {
'jquery' : 'empty:',
'store' : 'empty:',
'stripe' : 'empty:',
'cookie' : 'empty:',
'underscore': 'empty:',
'select2': 'empty:',
'urijs': 'empty:',
'typekit': 'empty:',
'autobahn' : 'empty:',
'numeral' : 'empty:'
},
}))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('app/js/dist'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment