diff --git a/generators/app/templates/_package.json b/generators/app/templates/_package.json index 7d92d77..0be0b17 100644 --- a/generators/app/templates/_package.json +++ b/generators/app/templates/_package.json @@ -36,17 +36,17 @@ "@angular/core": "^5.0.0", "@angular/platform-browser": "^5.0.0", "@angular/platform-browser-dynamic": "^5.0.0", - "@compodoc/compodoc": "^1.0.0-beta.10", + "@compodoc/compodoc": "^1.0.8", "@types/jasmine": "2.5.53", - "@types/node": "~6.0.60", - "angular-in-memory-web-api": "^0.3.2", + "@types/node": "~9.4.6", + "angular-in-memory-web-api": "^0.5.3", "codelyzer": "~3.2.0", - "concurrently": "^3.4.0", - "core-js": "^2.4.1", + "concurrently": "^3.5.1", + "core-js": "^2.5.3", "fs-extra": "^5.0.0", "gulp": "^3.9.1", "gulp-rename": "^1.2.2", - "gulp-rollup": "^2.15.0", + "gulp-rollup": "^2.16.2", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", @@ -58,16 +58,14 @@ "lite-server": "^2.3.0", "node-sass": "^4.5.2", "node-sass-tilde-importer": "^1.0.0", - "node-watch": "^0.5.2", "protractor": "~5.1.2", - "rollup": "^0.49.3", - "run-sequence": "^1.2.2", - "rxjs": "^5.5.2", - "systemjs": "^0.20.12", - "ts-node": "~3.2.0", - "tslint": "~5.7.0", - "typescript": "~2.4.2", - "zone.js": "^0.8.14" + "run-sequence": "^2.2.1", + "rxjs": "^5.5.6", + "systemjs": "^0.21.0", + "tslint": "~5.9.1", + "typescript": "~2.7.2", + "zone.js": "^0.8.20", + "rollup-plugin-uglify": "^3.0.0" }, "engines": { "node": ">=6.0.0" diff --git a/generators/app/templates/_package_jest.json b/generators/app/templates/_package_jest.json index d0b3eca..d9f1029 100644 --- a/generators/app/templates/_package_jest.json +++ b/generators/app/templates/_package_jest.json @@ -42,33 +42,31 @@ "@angular/core": "^5.0.0", "@angular/platform-browser": "^5.0.0", "@angular/platform-browser-dynamic": "^5.0.0", - "@compodoc/compodoc": "^1.0.0-beta.10", - "@types/node": "~6.0.60", + "@compodoc/compodoc": "^1.0.8", + "@types/node": "~9.4.6", "@types/jest": "^22.0.1", - "angular-in-memory-web-api": "^0.3.2", + "angular-in-memory-web-api": "^0.5.3", "codelyzer": "~3.2.0", - "concurrently": "^3.4.0", - "core-js": "^2.4.1", + "concurrently": "^3.5.1", + "core-js": "^2.5.3", "fs-extra": "^5.0.0", - "del": "^2.2.2", + "del": "^3.0.0", "gulp": "^3.9.1", "gulp-rename": "^1.2.2", - "gulp-rollup": "^2.11.0", + "gulp-rollup": "^2.16.2", "jest": "^22.1.4", "jest-preset-angular": "^5.0.0", "lite-server": "^2.3.0", "node-sass": "^4.5.2", "node-sass-tilde-importer": "^1.0.0", - "node-watch": "^0.5.2", "protractor": "~5.1.2", - "rollup": "^0.49.3", - "run-sequence": "^1.2.2", - "rxjs": "^5.5.2", + "run-sequence": "^2.2.1", + "rxjs": "^5.5.6", "systemjs": "^0.20.12", - "ts-node": "~3.2.0", - "tslint": "~5.7.0", - "typescript": "~2.4.2", - "zone.js": "^0.8.14" + "tslint": "~5.9.1", + "typescript": "~2.7.2", + "zone.js": "^0.8.20", + "rollup-plugin-uglify": "^3.0.0" }, "engines": { "node": ">=6.0.0" diff --git a/generators/app/templates/gulpfile.js b/generators/app/templates/gulpfile.js index aeb5add..0493535 100644 --- a/generators/app/templates/gulpfile.js +++ b/generators/app/templates/gulpfile.js @@ -6,7 +6,8 @@ var gulp = require('gulp'), rename = require('gulp-rename'), fs = require('fs-extra'), 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'); @@ -83,8 +84,14 @@ gulp.task('rollup:fesm', function () { // Format of generated bundle // See "format" in https://rollupjs.org/#core-functionality - format: 'es' + format: 'es', + + // Plugins + plugins: [ + uglify() + ] })) + .pipe(rename('<%= props.libraryName.kebabCase %>.js')) .pipe(gulp.dest(distFolder)); }); @@ -114,24 +121,30 @@ gulp.task('rollup:umd', function () { '@angular/common' ], - // Format of generated bundle - // See "format" in https://rollupjs.org/#core-functionality - format: 'umd', - - // Export mode to use - // See "exports" in https://rollupjs.org/#danger-zone - exports: 'named', - - // The name to use for the module for UMD/IIFE bundles - // (required for bundles with exports) - // See "name" in https://rollupjs.org/#core-functionality - name: '<%= props.libraryName.original %>', - - // See "globals" in https://rollupjs.org/#core-functionality - globals: { - typescript: 'ts' - } - + output: { + // Format of generated bundle + // See "format" in https://rollupjs.org/#core-functionality + format: 'umd', + + // Export mode to use + // See "exports" in https://rollupjs.org/#danger-zone + exports: 'named', + + // The name to use for the module for UMD/IIFE bundles + // (required for bundles with exports) + // See "name" in https://rollupjs.org/#core-functionality + name: '<%= props.libraryName.original %>', + + // See "globals" in https://rollupjs.org/#core-functionality + globals: { + '@angular/core': 'ng.core' + } + }, + + // Plugins + plugins: [ + uglify() + ] })) .pipe(rename('<%= props.libraryName.kebabCase %>.umd.js')) .pipe(gulp.dest(distFolder));