feat(webpack): support NG 13 and zone async/await (#9676)

* feat(webpack): support NG 13 and zone async/await

* chore: cleanup

* chore: remove require.resolve and update snapshots

Co-authored-by: Igor Randjelovic <rigor789@gmail.com>
This commit is contained in:
Eduardo Speroni
2021-11-30 12:51:34 -03:00
committed by GitHub
parent 37cc612263
commit c68f40f871
2 changed files with 58 additions and 1 deletions

View File

@ -1,5 +1,5 @@
import { ScriptTarget } from 'typescript';
import { extname, resolve } from 'path';
import { merge } from 'webpack-merge';
import Config from 'webpack-chain';
import { existsSync } from 'fs';
@ -167,6 +167,23 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
.use('angular-hot-loader')
.loader('angular-hot-loader');
});
// zone + async/await
config.module
.rule('angular-webpack-loader')
.test(/\.[cm]?[tj]sx?$/)
.exclude.add(
/[/\\](?:core-js|@babel|tslib|web-animations-js|web-streams-polyfill)[/\\]/
)
.end()
.resolve.set('fullySpecified', false)
.end()
.before('angular')
.use('webpack-loader')
.loader('@angular-devkit/build-angular/src/babel/webpack-loader')
.options({
scriptTarget: ScriptTarget.ESNext,
aot: true,
});
}
// look for platform specific polyfills first