Filipe Silva
e8f27f029a
feat(@angular/cli): support sourcemaps and minification in scripts
...
Adds sourcemap and minification to javascript added via the `scripts` array in `.angular-cli.json`.
`script-loader` is no longer used, which should help with CSP since it used `eval`.
Scripts will no longer appear in the console output for `ng build`, as they are now assets instead of webpack entry points.
It's no longer possible to have the `output` property of both a `scripts` and a `styles` entry pointing to the same file. This wasn't officially supported or listed in the docs, but used to be possible.
Fix #2796
Fix #7226
Fix #7290
Related to #6872
2017-08-17 16:38:35 -04:00
Filipe Silva
5a0e80ffd3
feat(@angular/cli): name lazy chunks
...
Before:
```
$ ng build --no-progress
Hash: ff03df269349b817eef4
Time: 11202ms
chunk {0} 0.chunk.js, 0.chunk.js.map 1.61 kB {1} {3} [rendered]
chunk {1} 1.chunk.js, 1.chunk.js.map 1.46 kB {0} {3} [rendered]
chunk {2} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {6} [initial] [rendered]
chunk {3} main.bundle.js, main.bundle.js.map (main) 6.38 kB {5} [initial] [rendered]
chunk {4} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {6} [initial] [rendered]
chunk {5} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.16 MB [initial] [rendered]
chunk {6} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
```
After:
```
$ ng build --no-progress
Hash: 2bc12a89f40f3b4818b5
Time: 9613ms
chunk {feature.module} feature.module.chunk.js, feature.module.chunk.js.map 1.46 kB {lazy.module} {main} [rendered]
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
chunk {lazy.module} lazy.module.chunk.js, lazy.module.chunk.js.map 1.61 kB {feature.module} {main} [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 6.38 kB {vendor} [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {inline} [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {inline} [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.16 MB [initial] [rendered]
```
Fix #6700
2017-07-05 14:50:52 -07:00