Firstly, thanks again to @hansl for implementing --bundle-dependencies.
Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
1.5.0-rc.0
Repro steps.
npm install -g @angular/cli@1.5.0-rc.0
ng new MyApp
cd MyApp
- Open your code editor, and modify
.angular-cli.json to add "platform": "server" to the config for the app.
ng build --prod --bundle-dependencies=all
Expected: Build completes without warnings/errors
Actual:
WARNING in ./node_modules/@angular/core/bundles/core.umd.js
5691:15-36 Critical dependency: the request of a dependency is an expression
at ImportLazyContextDependency.getWarnings (dir\MyApp\node_modules\webpack\lib\dependencies\ContextDependency.js:39:18)
at Compilation.reportDependencyErrorsAndWarnings (dir\MyApp\node_modules\webpack\lib\Compilation.js:701:24)
... plus many more lines of warnings.
Desired functionality.
Builds without errors/warnings in the default case for platform: server and --bundle-dependencies=all.
Mention any other details that might be useful.
In @angular/cli 1.4.x, it was possible to make fully-bundled server builds work without errors by modifying the node_modules/@angular/cli/models/webpack-configs/ files in two ways:
- By changing
server.js to set externals to an empty array
- By changing
production.js so that UglifyJsPlugin was not added to the plugins array for server builds.
However, in 1.5.0-rc.0, the Critical dependency: the request of a dependency is an expression warnings still happen regardless of UglifyJsPlugin. So something else must have changed in 1.5.0 to trigger these additional warnings.
Firstly, thanks again to @hansl for implementing
--bundle-dependencies.Bug Report or Feature Request (mark with an
x)Versions.
1.5.0-rc.0
Repro steps.
npm install -g @angular/cli@1.5.0-rc.0ng new MyAppcd MyApp.angular-cli.jsonto add"platform": "server"to the config for the app.ng build --prod --bundle-dependencies=allExpected: Build completes without warnings/errors
Actual:
... plus many more lines of warnings.
Desired functionality.
Builds without errors/warnings in the default case for
platform: serverand--bundle-dependencies=all.Mention any other details that might be useful.
In
@angular/cli1.4.x, it was possible to make fully-bundled server builds work without errors by modifying thenode_modules/@angular/cli/models/webpack-configs/files in two ways:server.jsto setexternalsto an empty arrayproduction.jsso thatUglifyJsPluginwas not added to the plugins array for server builds.However, in 1.5.0-rc.0, the
Critical dependency: the request of a dependency is an expressionwarnings still happen regardless ofUglifyJsPlugin. So something else must have changed in 1.5.0 to trigger these additional warnings.