Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit cb2703e

Browse files
clydinfilipesilva
authored andcommitted
feat(@angular-devkit/build-optimizer): deprecate purify/PurifyPlugin
1 parent 03cc6af commit cb2703e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/angular_devkit/build_optimizer/src/purify/cli.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { readFileSync, writeFileSync } from 'fs';
1010
import { join } from 'path';
1111
import { purify } from './purify';
1212

13+
console.warn('purify is deprecated and will be removed in 0.7.0.');
1314

1415
if (process.argv.length < 3 || process.argv.length > 4) {
1516
throw new Error(`

packages/angular_devkit/build_optimizer/src/purify/webpack-plugin.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
// tslint:disable-next-line:no-implicit-dependencies
9-
import * as webpack from 'webpack';
9+
import { Compiler, compilation } from 'webpack';
1010
import { ReplaceSource } from 'webpack-sources';
1111
import { purifyReplacements } from './purify';
1212

@@ -17,9 +17,11 @@ interface Chunk {
1717

1818
export class PurifyPlugin {
1919
constructor() { }
20-
public apply(compiler: webpack.Compiler): void {
21-
// tslint:disable-next-line:no-any
22-
compiler.plugin('compilation', (compilation: any) => {
20+
public apply(compiler: Compiler): void {
21+
compiler.plugin('compilation', (compilation: compilation.Compilation) => {
22+
// Webpack 4 provides the same functionality as this plugin and TS transformer
23+
compilation.warnings.push('PurifyPlugin is deprecated and will be removed in 0.7.0.');
24+
2325
compilation.plugin('optimize-chunk-assets', (chunks: Chunk[], callback: () => void) => {
2426
chunks.forEach((chunk: Chunk) => {
2527
chunk.files

0 commit comments

Comments
 (0)