Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,26 @@ exports[`angular configuration for android 1`] = `
}
]
},
/* config.module.rule('angular-webpack-loader') */
{
test: /\\\\.[cm]?[tj]sx?$/,
exclude: [
/[/\\\\\\\\](?:core-js|@babel|tslib|web-animations-js|web-streams-polyfill)[/\\\\\\\\]/
],
use: [
/* config.module.rule('angular-webpack-loader').use('webpack-loader') */
{
loader: '@angular-devkit/build-angular/src/babel/webpack-loader',
options: {
scriptTarget: 99,
aot: true
}
}
],
resolve: {
fullySpecified: false
}
},
/* config.module.rule('angular') */
{
test: /(?:\\\\.ngfactory.js|\\\\.ngstyle\\\\.js|\\\\.ts)$/,
Expand Down Expand Up @@ -559,6 +579,26 @@ exports[`angular configuration for ios 1`] = `
}
]
},
/* config.module.rule('angular-webpack-loader') */
{
test: /\\\\.[cm]?[tj]sx?$/,
exclude: [
/[/\\\\\\\\](?:core-js|@babel|tslib|web-animations-js|web-streams-polyfill)[/\\\\\\\\]/
],
use: [
/* config.module.rule('angular-webpack-loader').use('webpack-loader') */
{
loader: '@angular-devkit/build-angular/src/babel/webpack-loader',
options: {
scriptTarget: 99,
aot: true
}
}
],
resolve: {
fullySpecified: false
}
},
/* config.module.rule('angular') */
{
test: /(?:\\\\.ngfactory.js|\\\\.ngstyle\\\\.js|\\\\.ts)$/,
Expand Down
19 changes: 18 additions & 1 deletion packages/webpack5/src/configuration/angular.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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
Expand Down