Skip to content

Commit ab15248

Browse files
committed
add hmr;
fixed rickshaw build
1 parent 3f6d414 commit ab15248

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+76
-13960
lines changed

angular.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
"projectType": "application",
1010
"architect": {
1111
"build": {
12-
"builder": "@angular-devkit/build-angular:browser",
12+
"builder": "@angular-builders/custom-webpack:browser",
1313
"options": {
14+
"customWebpackConfig": {
15+
"path": "./extra-webpack.config.js"
16+
},
1417
"outputPath": "dist",
1518
"index": "src/index.html",
1619
"main": "src/main.ts",
@@ -80,18 +83,30 @@
8083
"with": "src/environments/environment.prod.ts"
8184
}
8285
]
86+
},
87+
"hmr": {
88+
"fileReplacements": [
89+
{
90+
"replace": "src/environments/environment.ts",
91+
"with": "src/environments/environment.hmr.ts"
92+
}
93+
]
8394
}
8495
}
8596
},
8697
"serve": {
87-
"builder": "@angular-devkit/build-angular:dev-server",
98+
"builder": "@angular-builders/custom-webpack:dev-server",
8899
"options": {
89100
"browserTarget": "Sing:build",
90101
"port": 3000
91102
},
92103
"configurations": {
93104
"production": {
94105
"browserTarget": "Sing:build:production"
106+
},
107+
"hmr": {
108+
"hmr": true,
109+
"browserTarget": "Sing:build:hmr"
95110
}
96111
}
97112
},

extra-webpack.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const TerserPlugin = require('terser-webpack-plugin');
2+
3+
module.exports = (config, options) => {
4+
config.optimization.minimizer.some(plugin => {
5+
if (plugin instanceof TerserPlugin) {
6+
// Warning: This config is using for stable Rickshaw lib working
7+
plugin.options.terserOptions.mangle = {
8+
reserved: ['$super']
9+
};
10+
return true;
11+
}
12+
return false;
13+
});
14+
return config;
15+
};

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
"install": "napa",
77
"ng": "ng",
88
"start": "ng serve",
9+
"hmr": "ng serve --configuration hmr",
910
"build": "ng build --prod",
1011
"test": "ng test",
1112
"lint": "ng lint"
1213
},
1314
"private": true,
1415
"dependencies": {
15-
"@agm/core": "1.0.0-beta.5",
16+
"@agm/core": "1.0.0-beta.6",
1617
"@angular/animations": "8.0.0",
1718
"@angular/common": "8.0.0",
1819
"@angular/compiler": "8.0.0",
@@ -91,16 +92,20 @@
9192
"jquery.flot-orderBars": "https://github.com/emmerich/flot-orderBars.git"
9293
},
9394
"devDependencies": {
95+
"@angular-builders/custom-webpack": "^8.1.0",
9496
"@angular-devkit/build-angular": "^0.800.2",
9597
"@angular/cli": "8.0.2",
9698
"@angular/compiler-cli": "8.0.0",
9799
"@angular/language-service": "8.0.0",
100+
"@angularclass/hmr": "^2.1.3",
98101
"@types/hammerjs": "2.0.36",
99102
"@types/node": "6.0.118",
100103
"@types/select2": "4.0.31",
101104
"codelyzer": "4.0.2",
102105
"metrojs": "0.9.77",
103106
"napa": "2.3.0",
107+
"rxjs-compat": "^6.5.2",
108+
"terser-webpack-plugin": "1.3.0",
104109
"ts-node": "4.1.0",
105110
"tslint": "5.9.1",
106111
"typescript": "3.4.5"
@@ -113,8 +118,6 @@
113118
}
114119
},
115120
"resolutions": {
116-
"@angular/core": "5.2.11",
117-
"uglifyjs-webpack-plugin": "file:src/build/uglifyJS",
118-
"@types/select2": "4.0.47"
121+
"terser-webpack-plugin": "1.3.0"
119122
}
120123
}

src/build/uglifyJS/CHANGELOG.md

Lines changed: 0 additions & 276 deletions
This file was deleted.

0 commit comments

Comments
 (0)