Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Commit

Permalink
feat(@angular-devkit/build-optimizer): deprecate purify/PurifyPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin authored and filipesilva committed May 22, 2018
1 parent 03cc6af commit cb2703e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/angular_devkit/build_optimizer/src/purify/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { readFileSync, writeFileSync } from 'fs';
import { join } from 'path';
import { purify } from './purify';

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

if (process.argv.length < 3 || process.argv.length > 4) {
throw new Error(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable-next-line:no-implicit-dependencies
import * as webpack from 'webpack';
import { Compiler, compilation } from 'webpack';
import { ReplaceSource } from 'webpack-sources';
import { purifyReplacements } from './purify';

Expand All @@ -17,9 +17,11 @@ interface Chunk {

export class PurifyPlugin {
constructor() { }
public apply(compiler: webpack.Compiler): void {
// tslint:disable-next-line:no-any
compiler.plugin('compilation', (compilation: any) => {
public apply(compiler: Compiler): void {
compiler.plugin('compilation', (compilation: compilation.Compilation) => {
// Webpack 4 provides the same functionality as this plugin and TS transformer
compilation.warnings.push('PurifyPlugin is deprecated and will be removed in 0.7.0.');

compilation.plugin('optimize-chunk-assets', (chunks: Chunk[], callback: () => void) => {
chunks.forEach((chunk: Chunk) => {
chunk.files
Expand Down

0 comments on commit cb2703e

Please sign in to comment.