build(aio): use cli 1.3.0-rc (#18290)

This commit is contained in:
Filipe Silva 2017-08-02 23:37:03 +01:00 committed by Victor Berchet
parent 89c616199f
commit 9adf40aa77
8 changed files with 454 additions and 176 deletions

View File

@ -16,15 +16,8 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser clearContext: false // leave Jasmine Spec Runner output visible in browser
}, },
files: [ files: [
{ pattern: './node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true }, { pattern: './node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true }
{ pattern: './src/test.ts', watched: false }
], ],
preprocessors: {
'./src/test.ts': ['@angular/cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
coverageIstanbulReporter: { coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ], reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true fixWebpackSourcePaths: true
@ -32,14 +25,13 @@ module.exports = function (config) {
angularCli: { angularCli: {
environment: 'dev' environment: 'dev'
}, },
reporters: config.angularCli && config.angularCli.codeCoverage reporters: ['progress', 'kjhtml'],
? ['progress', 'coverage-istanbul']
: ['progress', 'kjhtml'],
port: 9876, port: 9876,
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,
autoWatch: true, autoWatch: true,
browsers: ['Chrome'], browsers: ['Chrome'],
browserNoActivityTimeout: 60000,
singleRun: false singleRun: false
}); });
}; };

View File

@ -9,7 +9,7 @@
"ng": "yarn check-env && ng", "ng": "yarn check-env && ng",
"start": "yarn check-env && ng serve", "start": "yarn check-env && ng serve",
"prebuild": "yarn check-env && yarn setup", "prebuild": "yarn check-env && yarn setup",
"build": "ng build -prod -sm -vc=false", "build": "ng build -prod -sm -bo",
"postbuild": "yarn sw-manifest && yarn sw-copy", "postbuild": "yarn sw-manifest && yarn sw-copy",
"lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint", "lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint",
"test": "yarn check-env && ng test", "test": "yarn check-env && ng test",
@ -40,7 +40,7 @@
"generate-zips": "node ./tools/example-zipper/generateZips", "generate-zips": "node ./tools/example-zipper/generateZips",
"sw-manifest": "ngu-sw-manifest --dist dist --in ngsw-manifest.json --out dist/ngsw-manifest.json", "sw-manifest": "ngu-sw-manifest --dist dist --in ngsw-manifest.json --out dist/ngsw-manifest.json",
"sw-copy": "cp node_modules/@angular/service-worker/bundles/worker-basic.min.js dist/", "sw-copy": "cp node_modules/@angular/service-worker/bundles/worker-basic.min.js dist/",
"postinstall": "node tools/cli-patches/patch.js && uglifyjs node_modules/lunr/lunr.js -c -m -o src/assets/js/lunr.min.js --source-map", "postinstall": "uglifyjs node_modules/lunr/lunr.js -c -m -o src/assets/js/lunr.min.js --source-map",
"build-ie-polyfills": "node node_modules/webpack/bin/webpack.js -p src/ie-polyfills.js src/generated/ie-polyfills.min.js" "build-ie-polyfills": "node node_modules/webpack/bin/webpack.js -p src/ie-polyfills.js src/generated/ie-polyfills.min.js"
}, },
"engines": { "engines": {
@ -66,14 +66,13 @@
"core-js": "^2.4.1", "core-js": "^2.4.1",
"jasmine": "^2.6.0", "jasmine": "^2.6.0",
"ng-pwa-tools": "^0.0.10", "ng-pwa-tools": "^0.0.10",
"ngo": "angular/ngo",
"rxjs": "^5.2.0", "rxjs": "^5.2.0",
"tslib": "^1.7.1", "tslib": "^1.7.1",
"web-animations-js": "^2.2.5", "web-animations-js": "^2.2.5",
"zone.js": "^0.8.12" "zone.js": "^0.8.12"
}, },
"devDependencies": { "devDependencies": {
"@angular/cli": "angular/cli-builds#webpack-next", "@angular/cli": "1.3.0-rc.3",
"@angular/compiler-cli": "^4.3.1", "@angular/compiler-cli": "^4.3.1",
"@types/jasmine": "^2.5.52", "@types/jasmine": "^2.5.52",
"@types/node": "~6.0.60", "@types/node": "~6.0.60",

View File

@ -1,14 +0,0 @@
--- node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-12 14:30:22.000000000 -0700
+++ node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-12 14:32:23.000000000 -0700
@@ -68,6 +68,11 @@
}
return {
entry: entryPoints,
+ module: {
+ rules: [
+ {"test": /\.js$/, "use": {loader: "ngo/webpack-loader", options: { sourceMap: true }}},
+ ]
+ },
plugins: [
new webpack.EnvironmentPlugin({
'NODE_ENV': 'production'

View File

@ -1,12 +0,0 @@
const fs = require('fs');
const sh = require('shelljs');
PATCH_LOCK = 'node_modules/@angular/cli/models/webpack-configs/.patched';
if (!fs.existsSync(PATCH_LOCK)) {
sh.exec('patch -p0 -i tools/cli-patches/ngo.patch');
sh.exec('patch -p0 -i tools/cli-patches/purify.patch');
sh.exec('patch -p0 -i tools/cli-patches/scope-hoisting.patch');
sh.exec('patch -p0 -i tools/cli-patches/uglify-config.patch');
sh.touch(PATCH_LOCK);
}

View File

@ -1,10 +0,0 @@
--- node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-11 12:10:46.000000000 -0700
+++ node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-11 12:10:11.000000000 -0700
@@ -73,6 +73,7 @@
'NODE_ENV': 'production'
}),
new webpack.HashedModuleIdsPlugin(),
+ new (require("ngo").PurifyPlugin)(),
new webpack.optimize.UglifyJsPlugin({
mangle: { screw_ie8: true },
compress: { screw_ie8: true, warnings: buildOptions.verbose },

View File

@ -1,10 +0,0 @@
--- node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-24 15:36:43.000000000 -0700
+++ node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-24 15:37:04.000000000 -0700
@@ -85,6 +85,7 @@
'NODE_ENV': 'production'
}),
new webpack.HashedModuleIdsPlugin(),
+ new webpack.optimize.ModuleConcatenationPlugin(),
new (require("ngo").PurifyPlugin)(),
new webpack.optimize.UglifyJsPlugin({
mangle: true,

View File

@ -1,11 +0,0 @@
--- node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-24 15:36:43.000000000 -0700
+++ node_modules/@angular/cli/models/webpack-configs/production.js 2017-05-24 15:37:04.000000000 -0700
@@ -82,7 +82,7 @@
new (require("purify/purify-webpack-plugin"))(),
new webpack.optimize.UglifyJsPlugin({
mangle: { screw_ie8: true },
- compress: { screw_ie8: true, warnings: buildOptions.verbose },
+ compress: { screw_ie8: true, warnings: buildOptions.verbose, pure_getters: true },
sourceMap: buildOptions.sourcemaps,
comments: false
})

File diff suppressed because it is too large Load Diff