This repository was archived by the owner on Aug 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-20
lines changed
Expand file tree Collapse file tree 2 files changed +23
-20
lines changed Original file line number Diff line number Diff line change 11{
22 "presets" : [
3- [ " env" , {
3+ [ " @babel/preset- env" , {
44 "modules" : false ,
55 "targets" : {
66 "browsers" : [
1919 } ]
2020 ],
2121 "plugins" : [
22- " transform-object-rest-spread" ,
23- [ " transform-react-jsx" , {
22+ " @babel/plugin- transform-object-rest-spread" ,
23+ [ " @babel/plugin- transform-react-jsx" , {
2424 "pragma" : " wp.element.createElement"
2525 } ]
2626 ],
2727 "env" : {
2828 "default" : {
2929 "plugins" : [
3030 " lodash" ,
31- " transform-runtime"
31+ " @babel/plugin- transform-runtime"
3232 ]
33- },
33+ }
3434 }
35- }
35+ }
Original file line number Diff line number Diff line change 88
99const webpack = require ( 'webpack' ) ;
1010const glob = require ( 'glob' ) ;
11- const UglifyJsPlugin = require ( 'uglifyjs -webpack-plugin' ) ;
11+ const TerserPlugin = require ( 'terser -webpack-plugin' ) ;
1212
1313const externals = {
1414 react : 'React' ,
@@ -60,22 +60,25 @@ module.exports = [
6060 }
6161] ;
6262
63- if ( process . env . NODE_ENV === 'production' ) {
64- for ( var moduleConfig of module . exports ) {
65- moduleConfig . plugins = (
66- moduleConfig . plugins || [ ]
67- ) . concat (
68- [
69- new UglifyJsPlugin ( {
70- sourceMap : true ,
71- uglifyOptions : {
63+ if ( process . env . NODE_ENV === 'production' ) {
64+ for ( var moduleConfig of module . exports ) {
65+ moduleConfig . optimization = {
66+ minimize : true ,
67+ minimizer : [
68+ new TerserPlugin ( {
69+ extractComments : false ,
70+ terserOptions : {
7271 ecma : 8 ,
7372 compress : {
7473 warnings : false
75- }
74+ } ,
75+ output : {
76+ comments : false
77+ } ,
78+ sourceMap : true
7679 }
77- } )
80+ } )
7881 ]
79- ) ;
82+ } ;
8083 }
81- }
84+ }
You can’t perform that action at this time.
0 commit comments