Skip to content

Commit a1ea3a0

Browse files
clydinKeen Yee Liau
authored and
Keen Yee Liau
committedSep 7, 2018
fix(@angular-devkit/build-optimizer): remove deprecated purify plugin
1 parent f7f1d13 commit a1ea3a0

File tree

7 files changed

+3
-246
lines changed

7 files changed

+3
-246
lines changed
 

‎packages/angular_devkit/build_optimizer/README.md

+2-18
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Transformations applied depend on file content:
1010
- [Class fold](#class-fold), [Scrub file](#scrub-file) and [Prefix functions](#prefix-functions): applied to Angular apps and libraries.
1111
- [Import tslib](#import-tslib): applied when TypeScript helpers are found.
1212

13-
Non-transform optimizations are applied via the [Purify Plugin](#purify-plugin).
14-
1513
Some of these optimizations add `/*@__PURE__*/` comments.
1614
These are used by [UglifyJS](https://github.com/mishoo/UglifyJS2) to identify pure functions that can potentially be dropped.
1715

@@ -85,7 +83,6 @@ var ComponentClazz = (function () {
8583
### Prefix functions
8684

8785
Adds `/*@__PURE__*/` comments to top level downleveled class declarations and instantiation.
88-
Webpack library imports are also marked as `/*@__PURE__*/` when used with [Purify Plugin](#purify-plugin).
8986

9087
Warning: this transform assumes the file is a pure module. It should not be used with unpure modules.
9188

@@ -165,12 +162,6 @@ var ChangeDetectionStrategy = /*@__PURE__*/ (function () {
165162
```
166163

167164

168-
### Purify Plugin
169-
170-
Performs regex based replacements on all bundles that add `/*@__PURE__*/` comments to
171-
known pure webpack imports (used with [Prefix functions](#prefix-functions)).
172-
173-
174165
## Library Usage
175166

176167
```typescript
@@ -192,11 +183,9 @@ export interface BuildOptimizerOptions {
192183
```
193184

194185

195-
## Webpack loader and plugin usage:
186+
## Webpack loader usage:
196187

197188
```typescript
198-
const PurifyPlugin = require('@angular-devkit/build-optimizer').PurifyPlugin;
199-
200189
module.exports = {
201190
module: {
202191
rules: [
@@ -208,10 +197,7 @@ module.exports = {
208197
}
209198
}
210199
]
211-
},
212-
plugins: [
213-
new PurifyPlugin()
214-
]
200+
}
215201
}
216202
```
217203

@@ -221,6 +207,4 @@ module.exports = {
221207
```bash
222208
build-optimizer input.js
223209
build-optimizer input.js output.js
224-
purify input.js
225-
purify input.js output.js
226210
```

‎packages/angular_devkit/build_optimizer/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"main": "src/index.js",
66
"typings": "src/index.d.ts",
77
"bin": {
8-
"build-optimizer": "./src/build-optimizer/cli.js",
9-
"purify": "./src/purify/cli.js"
8+
"build-optimizer": "./src/build-optimizer/cli.js"
109
},
1110
"dependencies": {
1211
"loader-utils": "^1.1.0",

‎packages/angular_devkit/build_optimizer/src/index.ts

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
export { default as buildOptimizerLoader } from './build-optimizer/webpack-loader';
99
export { buildOptimizer } from './build-optimizer/build-optimizer';
1010

11-
export { PurifyPlugin } from './purify/webpack-plugin';
12-
export { purify } from './purify/purify';
13-
1411
export { transformJavascript } from './helpers/transform-javascript';
1512

1613
export { getFoldFileTransformer } from './transforms/class-fold';

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

-40
This file was deleted.

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

-73
This file was deleted.

‎packages/angular_devkit/build_optimizer/src/purify/purify_spec.ts

-65
This file was deleted.

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

-45
This file was deleted.

0 commit comments

Comments
 (0)