mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-24 16:16:27 +08:00
refactor(@angular-devkit/build-angular): remove use of deprecated ngtools ivy namespace export
With the removal of the deprecated ViewEngine-based Webpack plugin, the ivy namespace export that was previously used is now deprecated in favor of direct exports of the Ivy-based plugin.
This commit is contained in:
parent
03a00ee2c8
commit
8770d5f015
@ -8,7 +8,7 @@
|
|||||||
import { buildOptimizerLoaderPath } from '@angular-devkit/build-optimizer';
|
import { buildOptimizerLoaderPath } from '@angular-devkit/build-optimizer';
|
||||||
import { getSystemPath } from '@angular-devkit/core';
|
import { getSystemPath } from '@angular-devkit/core';
|
||||||
import { CompilerOptions } from '@angular/compiler-cli';
|
import { CompilerOptions } from '@angular/compiler-cli';
|
||||||
import { ivy } from '@ngtools/webpack';
|
import { AngularWebpackLoaderPath, AngularWebpackPlugin } from '@ngtools/webpack';
|
||||||
import { WebpackConfigOptions } from '../../utils/build-options';
|
import { WebpackConfigOptions } from '../../utils/build-options';
|
||||||
|
|
||||||
function ensureIvy(wco: WebpackConfigOptions): void {
|
function ensureIvy(wco: WebpackConfigOptions): void {
|
||||||
@ -30,7 +30,7 @@ function createIvyPlugin(
|
|||||||
wco: WebpackConfigOptions,
|
wco: WebpackConfigOptions,
|
||||||
aot: boolean,
|
aot: boolean,
|
||||||
tsconfig: string,
|
tsconfig: string,
|
||||||
): ivy.AngularWebpackPlugin {
|
): AngularWebpackPlugin {
|
||||||
const { buildOptions } = wco;
|
const { buildOptions } = wco;
|
||||||
const optimize = buildOptions.optimization.scripts;
|
const optimize = buildOptions.optimization.scripts;
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ function createIvyPlugin(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ivy.AngularWebpackPlugin({
|
return new AngularWebpackPlugin({
|
||||||
tsconfig,
|
tsconfig,
|
||||||
compilerOptions,
|
compilerOptions,
|
||||||
fileReplacements,
|
fileReplacements,
|
||||||
@ -68,7 +68,7 @@ export function getNonAotConfig(wco: WebpackConfigOptions) {
|
|||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.[jt]sx?$/,
|
test: /\.[jt]sx?$/,
|
||||||
loader: ivy.AngularWebpackLoaderPath,
|
loader: AngularWebpackLoaderPath,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -97,13 +97,13 @@ export function getAotConfig(wco: WebpackConfigOptions) {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
ivy.AngularWebpackLoaderPath,
|
AngularWebpackLoaderPath,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// "allowJs" support with ivy plugin - ensures build optimizer is not run twice
|
// "allowJs" support with ivy plugin - ensures build optimizer is not run twice
|
||||||
{
|
{
|
||||||
test: /\.jsx?$/,
|
test: /\.jsx?$/,
|
||||||
use: [ivy.AngularWebpackLoaderPath],
|
use: [AngularWebpackLoaderPath],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user