angular-cli: Angular 6.04 ,building sourceMap cause ng serve slow

Bug Report or Feature Request (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [x ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Angular CLI: 6.1.2 Node: v8.11.3 npm: 6.2.0

Repro steps

### " 92% after chunk asset optimization SourceMapDevToolPlugin main.js generate SourceMap " too slow

After upgrade angular to 6.04, ng serve takes 5 minutes building source map.( SourceMapDevToolPlugin is very slow). Modifying source code take 5 minutes to regenerate source map too.

Is there any way to decrease the time building source map during ng serve ? I don’t want to use --source-map=false option. use --max-old-space-size does not do any help.

The log given by the failure

Desired functionality

Mention any other details that might be useful

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (1 by maintainers)

Most upvoted comments

For us the new webpack-sources update seems to improve the speed:

Initial build is back to the previous performance:

Time: 56654ms
chunk {main} main.js, main.js.map (main) 7.14 MB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 420 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 239 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 4.15 MB [initial] [rendered]
i ?wdm?: Compiled successfully.

Rebuild is still a bit slower, but I’d say it’s now in the acceptable region:

Date: 2018-09-04T13:48:10.374Z - Hash: 4799daa924af20604696 - Time: 14137ms
4 unchanged chunks
chunk {main} main.js, main.js.map (main) 7.14 MB [initial] [rendered]
i ?wdm?: Compiled successfully.

Also a quick note that 1.2.0 will be the minimum required version in CLI 7.0.

I can also confirm large performance improvement, Updated package-lock.json or yarn.lock.json to version "1.2.0" at webpack-sources node

webpack-sources@^1.0.1, webpack-sources@^1.1.0:
  version "1.2.0"
  resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.2.0.tgz#18181e0d013fce096faf6f8e6d41eeffffdceac2"
  dependencies:
    source-list-map "^2.0.0"
    source-map "~0.6.1"

all 6+ angular-cli versions are crashed, fuckin 92% chunk… build 2+ minutes, serve breaks after recompiling, takes 12+ hours on jenkins; but for now using angular cli 1.7.4: webpack: Compiling… Time: 773ms webpack: Compiled successfully.