Skip to content

Commit 6722849

Browse files
committed
fix #1215. Simplify terser config
1 parent fbdf7e3 commit 6722849

File tree

19 files changed

+38
-645
lines changed

19 files changed

+38
-645
lines changed

frameworks/keyed/angular/webpack.config.js

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -27,44 +27,8 @@ module.exports = {
2727
}]
2828
},
2929
optimization: {
30-
minimizer: [
31-
new TerserPlugin({
32-
terserOptions: {
33-
parse: {
34-
// we want terser to parse ecma 8 code. However, we don't want it
35-
// to apply any minfication steps that turns valid ecma 5 code
36-
// into invalid ecma 5 code. This is why the 'compress' and 'output'
37-
// sections only apply transformations that are ecma 5 safe
38-
// https://github.com/facebook/create-react-app/pull/4234
39-
ecma: 8,
40-
},
41-
compress: {
42-
ecma: 5,
43-
warnings: false,
44-
// Disabled because of an issue with Uglify breaking seemingly valid code:
45-
// https://github.com/facebook/create-react-app/issues/2376
46-
// Pending further investigation:
47-
// https://github.com/mishoo/UglifyJS2/issues/2011
48-
comparisons: false,
49-
},
50-
mangle: {
51-
safari10: true,
52-
},
53-
output: {
54-
ecma: 5,
55-
comments: false,
56-
// Turned on because emoji and regex is not minified properly using default
57-
// https://github.com/facebook/create-react-app/issues/2488
58-
ascii_only: true,
59-
},
60-
},
61-
// Use multi-process parallel running to improve the build speed
62-
// Default number of concurrent runs: os.cpus().length - 1
63-
parallel: true,
64-
// Enable file caching
65-
cache: true,
66-
}),
67-
]
30+
minimize: true,
31+
minimizer: [new TerserPlugin()],
6832
},
6933
plugins: [
7034
new webpack.DefinePlugin({

frameworks/keyed/glimmer-2/webpack.config.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,8 @@ module.exports = {
3131
],
3232
},
3333
optimization: {
34-
minimizer: [
35-
new TerserPlugin({
36-
terserOptions: {
37-
output: {
38-
comments: false,
39-
},
40-
},
41-
extractComments: false,
42-
parallel: true,
43-
// Enable file caching
44-
}),
45-
]
34+
minimize: true,
35+
minimizer: [new TerserPlugin()],
4636
},
4737
plugins: [
4838
new webpack.DefinePlugin({

frameworks/keyed/rax/webpack.config.js

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,42 +31,8 @@ module.exports = {
3131
}]
3232
},
3333
optimization: {
34-
minimizer: [
35-
new TerserPlugin({
36-
terserOptions: {
37-
parse: {
38-
// we want terser to parse ecma 8 code. However, we don't want it
39-
// to apply any minfication steps that turns valid ecma 5 code
40-
// into invalid ecma 5 code. This is why the 'compress' and 'output'
41-
// sections only apply transformations that are ecma 5 safe
42-
// https://github.com/facebook/create-react-app/pull/4234
43-
ecma: 8,
44-
},
45-
compress: {
46-
ecma: 5,
47-
warnings: false,
48-
// Disabled because of an issue with Uglify breaking seemingly valid code:
49-
// https://github.com/facebook/create-react-app/issues/2376
50-
// Pending further investigation:
51-
// https://github.com/mishoo/UglifyJS2/issues/2011
52-
comparisons: false,
53-
},
54-
mangle: {
55-
safari10: true,
56-
},
57-
output: {
58-
ecma: 5,
59-
comments: false,
60-
// Turned on because emoji and regex is not minified properly using default
61-
// https://github.com/facebook/create-react-app/issues/2488
62-
ascii_only: true,
63-
},
64-
},
65-
// Use multi-process parallel running to improve the build speed
66-
// Default number of concurrent runs: os.cpus().length - 1
67-
parallel: true
68-
}),
69-
]
34+
minimize: true,
35+
minimizer: [new TerserPlugin()],
7036
},
7137
plugins: [
7238
new webpack.DefinePlugin({

frameworks/keyed/react-hooks-use-transition/webpack.config.js

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,42 +30,8 @@ module.exports = {
3030
}]
3131
},
3232
optimization: {
33-
minimizer: [
34-
new TerserPlugin({
35-
terserOptions: {
36-
parse: {
37-
// we want terser to parse ecma 8 code. However, we don't want it
38-
// to apply any minfication steps that turns valid ecma 5 code
39-
// into invalid ecma 5 code. This is why the 'compress' and 'output'
40-
// sections only apply transformations that are ecma 5 safe
41-
// https://github.com/facebook/create-react-app/pull/4234
42-
ecma: 8,
43-
},
44-
compress: {
45-
ecma: 5,
46-
warnings: false,
47-
// Disabled because of an issue with Uglify breaking seemingly valid code:
48-
// https://github.com/facebook/create-react-app/issues/2376
49-
// Pending further investigation:
50-
// https://github.com/mishoo/UglifyJS2/issues/2011
51-
comparisons: false,
52-
},
53-
mangle: {
54-
safari10: true,
55-
},
56-
output: {
57-
ecma: 5,
58-
comments: false,
59-
// Turned on because emoji and regex is not minified properly using default
60-
// https://github.com/facebook/create-react-app/issues/2488
61-
ascii_only: true,
62-
},
63-
},
64-
// Use multi-process parallel running to improve the build speed
65-
// Default number of concurrent runs: os.cpus().length - 1
66-
parallel: true
67-
}),
68-
]
33+
minimize: true,
34+
minimizer: [new TerserPlugin()],
6935
},
7036
plugins: [
7137
new webpack.DefinePlugin({

frameworks/keyed/react-hooks/webpack.config.js

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,42 +30,8 @@ module.exports = {
3030
}]
3131
},
3232
optimization: {
33-
minimizer: [
34-
new TerserPlugin({
35-
terserOptions: {
36-
parse: {
37-
// we want terser to parse ecma 8 code. However, we don't want it
38-
// to apply any minfication steps that turns valid ecma 5 code
39-
// into invalid ecma 5 code. This is why the 'compress' and 'output'
40-
// sections only apply transformations that are ecma 5 safe
41-
// https://github.com/facebook/create-react-app/pull/4234
42-
ecma: 8,
43-
},
44-
compress: {
45-
ecma: 5,
46-
warnings: false,
47-
// Disabled because of an issue with Uglify breaking seemingly valid code:
48-
// https://github.com/facebook/create-react-app/issues/2376
49-
// Pending further investigation:
50-
// https://github.com/mishoo/UglifyJS2/issues/2011
51-
comparisons: false,
52-
},
53-
mangle: {
54-
safari10: true,
55-
},
56-
output: {
57-
ecma: 5,
58-
comments: false,
59-
// Turned on because emoji and regex is not minified properly using default
60-
// https://github.com/facebook/create-react-app/issues/2488
61-
ascii_only: true,
62-
},
63-
},
64-
// Use multi-process parallel running to improve the build speed
65-
// Default number of concurrent runs: os.cpus().length - 1
66-
parallel: true
67-
}),
68-
]
33+
minimize: true,
34+
minimizer: [new TerserPlugin()],
6935
},
7036
plugins: [
7137
new webpack.DefinePlugin({

frameworks/keyed/react-mlyn/webpack.config.js

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -40,42 +40,8 @@ module.exports = {
4040
],
4141
},
4242
optimization: {
43-
minimizer: [
44-
new TerserPlugin({
45-
terserOptions: {
46-
parse: {
47-
// we want terser to parse ecma 8 code. However, we don't want it
48-
// to apply any minfication steps that turns valid ecma 5 code
49-
// into invalid ecma 5 code. This is why the 'compress' and 'output'
50-
// sections only apply transformations that are ecma 5 safe
51-
// https://github.com/facebook/create-react-app/pull/4234
52-
ecma: 8,
53-
},
54-
compress: {
55-
ecma: 5,
56-
warnings: false,
57-
// Disabled because of an issue with Uglify breaking seemingly valid code:
58-
// https://github.com/facebook/create-react-app/issues/2376
59-
// Pending further investigation:
60-
// https://github.com/mishoo/UglifyJS2/issues/2011
61-
comparisons: false,
62-
},
63-
mangle: {
64-
safari10: true,
65-
},
66-
output: {
67-
ecma: 5,
68-
comments: false,
69-
// Turned on because emoji and regex is not minified properly using default
70-
// https://github.com/facebook/create-react-app/issues/2488
71-
ascii_only: true,
72-
},
73-
},
74-
// Use multi-process parallel running to improve the build speed
75-
// Default number of concurrent runs: os.cpus().length - 1
76-
parallel: true
77-
}),
78-
],
43+
minimize: true,
44+
minimizer: [new TerserPlugin()],
7945
},
8046
plugins: [
8147
new webpack.DefinePlugin({

frameworks/keyed/react-recoil/webpack.config.js

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,42 +30,8 @@ module.exports = {
3030
}]
3131
},
3232
optimization: {
33-
minimizer: [
34-
new TerserPlugin({
35-
terserOptions: {
36-
parse: {
37-
// we want terser to parse ecma 8 code. However, we don't want it
38-
// to apply any minfication steps that turns valid ecma 5 code
39-
// into invalid ecma 5 code. This is why the 'compress' and 'output'
40-
// sections only apply transformations that are ecma 5 safe
41-
// https://github.com/facebook/create-react-app/pull/4234
42-
ecma: 8,
43-
},
44-
compress: {
45-
ecma: 5,
46-
warnings: false,
47-
// Disabled because of an issue with Uglify breaking seemingly valid code:
48-
// https://github.com/facebook/create-react-app/issues/2376
49-
// Pending further investigation:
50-
// https://github.com/mishoo/UglifyJS2/issues/2011
51-
comparisons: false,
52-
},
53-
mangle: {
54-
safari10: true,
55-
},
56-
output: {
57-
ecma: 5,
58-
comments: false,
59-
// Turned on because emoji and regex is not minified properly using default
60-
// https://github.com/facebook/create-react-app/issues/2488
61-
ascii_only: true,
62-
},
63-
},
64-
// Use multi-process parallel running to improve the build speed
65-
// Default number of concurrent runs: os.cpus().length - 1
66-
parallel: true,
67-
}),
68-
]
33+
minimize: true,
34+
minimizer: [new TerserPlugin()],
6935
},
7036
plugins: [
7137
new webpack.DefinePlugin({

frameworks/keyed/react-redux-hooks/webpack.config.js

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,42 +31,8 @@ module.exports = {
3131
}]
3232
},
3333
optimization: {
34-
minimizer: [
35-
new TerserPlugin({
36-
terserOptions: {
37-
parse: {
38-
// we want terser to parse ecma 8 code. However, we don't want it
39-
// to apply any minfication steps that turns valid ecma 5 code
40-
// into invalid ecma 5 code. This is why the 'compress' and 'output'
41-
// sections only apply transformations that are ecma 5 safe
42-
// https://github.com/facebook/create-react-app/pull/4234
43-
ecma: 8,
44-
},
45-
compress: {
46-
ecma: 5,
47-
warnings: false,
48-
// Disabled because of an issue with Uglify breaking seemingly valid code:
49-
// https://github.com/facebook/create-react-app/issues/2376
50-
// Pending further investigation:
51-
// https://github.com/mishoo/UglifyJS2/issues/2011
52-
comparisons: false,
53-
},
54-
mangle: {
55-
safari10: true,
56-
},
57-
output: {
58-
ecma: 5,
59-
comments: false,
60-
// Turned on because emoji and regex is not minified properly using default
61-
// https://github.com/facebook/create-react-app/issues/2488
62-
ascii_only: true,
63-
},
64-
},
65-
// Use multi-process parallel running to improve the build speed
66-
// Default number of concurrent runs: os.cpus().length - 1
67-
parallel: true
68-
}),
69-
]
34+
minimize: true,
35+
minimizer: [new TerserPlugin()],
7036
},
7137
plugins: [
7238
new webpack.DefinePlugin({

frameworks/keyed/react-redux-rematch/webpack.config.js

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,42 +31,8 @@ module.exports = {
3131
}]
3232
},
3333
optimization: {
34-
minimizer: [
35-
new TerserPlugin({
36-
terserOptions: {
37-
parse: {
38-
// we want terser to parse ecma 8 code. However, we don't want it
39-
// to apply any minfication steps that turns valid ecma 5 code
40-
// into invalid ecma 5 code. This is why the 'compress' and 'output'
41-
// sections only apply transformations that are ecma 5 safe
42-
// https://github.com/facebook/create-react-app/pull/4234
43-
ecma: 8,
44-
},
45-
compress: {
46-
ecma: 5,
47-
warnings: false,
48-
// Disabled because of an issue with Uglify breaking seemingly valid code:
49-
// https://github.com/facebook/create-react-app/issues/2376
50-
// Pending further investigation:
51-
// https://github.com/mishoo/UglifyJS2/issues/2011
52-
comparisons: false,
53-
},
54-
mangle: {
55-
safari10: true,
56-
},
57-
output: {
58-
ecma: 5,
59-
comments: false,
60-
// Turned on because emoji and regex is not minified properly using default
61-
// https://github.com/facebook/create-react-app/issues/2488
62-
ascii_only: true,
63-
},
64-
},
65-
// Use multi-process parallel running to improve the build speed
66-
// Default number of concurrent runs: os.cpus().length - 1
67-
parallel: true
68-
}),
69-
]
34+
minimize: true,
35+
minimizer: [new TerserPlugin()],
7036
},
7137
plugins: [
7238
new webpack.DefinePlugin({

0 commit comments

Comments
 (0)