Skip to content

Commit

Permalink
feat(umd): uglify the umd bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
izifortune committed Jun 19, 2017
1 parent 38bd3d1 commit 4917595
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions generators/app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"node-watch": "^0.5.2",
"protractor": "~5.1.0",
"rollup": "^0.41.6",
"rollup-plugin-uglify": "^2.0.1",
"run-sequence": "^1.2.2",
"rxjs": "^5.1.0",
"ts-node": "~2.0.0",
Expand Down
13 changes: 10 additions & 3 deletions generators/app/templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ var gulp = require('gulp'),
rename = require('gulp-rename'),
del = require('del'),
runSequence = require('run-sequence'),
inlineResources = require('./tools/gulp/inline-resources');
inlineResources = require('./tools/gulp/inline-resources'),
uglify = require('rollup-plugin-uglify');

const rootFolder = path.join(__dirname);
const srcFolder = path.join(rootFolder, 'src');
Expand Down Expand Up @@ -136,8 +137,14 @@ gulp.task('rollup:umd', function () {
// See https://github.com/rollup/rollup/wiki/JavaScript-API#globals
globals: {
typescript: 'ts'
}

},

// https://github.com/TrySound/rollup-plugin-uglify to uglify the .umd
// For all the options you can have a look at
// https://github.com/mishoo/UglifyJS2#api-reference
plugins: [
uglify()
]
}))
.pipe(rename('<%= props.libraryName.kebabCase %>.umd.js'))
.pipe(gulp.dest(distFolder));
Expand Down

0 comments on commit 4917595

Please sign in to comment.