feat(webpack): angular12 support & looser dependencies (#9441)

* chore: dep scoping

* chore: carrots for all dep major versions

* chore: dev.1

* chore: use at least min of 5.34 on webpack

* chore: ignore angular warnings

* feat: add hmr support for angular 12

* feat: custom hmr dispose logic for angular 12

* chore: dev.3

* chore: ignore warnings

* chore: dev.4

* chore: ignore ivy compiled warnings

* chore: dev.5

Co-authored-by: Eduardo Speroni <edusperoni@gmail.com>
This commit is contained in:
Nathan Walker
2021-06-08 11:35:21 -07:00
committed by GitHub
parent dea18978d5
commit 93843b7b4e
5 changed files with 215 additions and 38 deletions

View File

@ -146,6 +146,15 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
tsconfig: tsConfigPath,
},
]);
config.when(env.hmr, (config) => {
config.module
.rule('angular-hmr')
.enforce('post')
.test(getEntryPath())
.use('angular-hmr-loader')
.loader('angular-hmr-loader');
});
}
// look for platform specific polyfills first
@ -192,6 +201,15 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
* +-----------------------------------------------------------------------------------------+
*/
/environment(\.(\w+))?\.ts is part of the TypeScript compilation but it's unused/,
/**
* This rule hides
*/
{
module: /@angular\/core\/(__ivy_ngcc__\/)?fesm2015\/core.js/,
message: /Critical dependency: the request of a dependency is an expression/,
},
/core\/profiling/,
/core\/ui\/styling/,
])
);