Skip to content

Commit 03d4a2a

Browse files
committed
[fix] 解决打包时报错,uglify 无法识别 es6 中的 ?. 和 ??.
解决办法参考: https://github.com/webpack-contrib/uglifyjs-webpack-plugin/releases/tag/v2.0.0 https://github.com/webpack-contrib/terser-webpack-plugin
1 parent 17e3f59 commit 03d4a2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"release-leaflet-es6": "cross-env moduleVersion=es6 npm run deploy-leaflet ./src/leaflet/namespace.js ./src/leaflet/css/index.js && node ./node_modules/uglify-es/bin/uglifyjs ./dist/leaflet/iclient-leaflet-es6.js --ecma 6 --comments /Copyright©/i -c -m -o ./dist/leaflet/iclient-leaflet-es6.min.js && cleancss -o ./dist/leaflet/iclient-leaflet.min.css ./dist/leaflet/iclient-leaflet.css",
2525
"release-openlayers-es6": "cross-env moduleVersion=es6 npm run deploy-openlayers ./src/openlayers/namespace.js ./src/openlayers/css/index.js && node ./node_modules/uglify-es/bin/uglifyjs ./dist/openlayers/iclient-openlayers-es6.js --ecma 6 --comments /Copyright©/i -c -m -o ./dist/openlayers/iclient-openlayers-es6.min.js && cleancss -o ./dist/openlayers/iclient-openlayers.min.css ./dist/openlayers/iclient-openlayers.css",
2626
"release-ol-es6": "cross-env moduleVersion=es6 npm run deploy-ol ./src/openlayers/namespace.js ./src/openlayers/css/index.js && node ./node_modules/uglify-es/bin/uglifyjs ./dist/ol/iclient-ol-es6.js --ecma 6 --comments /Copyright©/i -c -m -o ./dist/ol/iclient-ol-es6.min.js && cleancss -o ./dist/ol/iclient-ol.min.css ./dist/ol/iclient-ol.css",
27-
"release-mapboxgl-es6": "cross-env moduleVersion=es6 npm run deploy-mapboxgl ./src/mapboxgl/namespace.js ./src/mapboxgl/css/index.js && node ./node_modules/uglify-es/bin/uglifyjs ./dist/mapboxgl/iclient-mapboxgl-es6.js --ecma 6 --comments /Copyright©/i -c -m -o ./dist/mapboxgl/iclient-mapboxgl-es6.min.js && cleancss -o ./dist/mapboxgl/iclient-mapboxgl.min.css ./dist/mapboxgl/iclient-mapboxgl.css",
27+
"release-mapboxgl-es6": "cross-env moduleVersion=es6 npm run deploy-mapboxgl ./src/mapboxgl/namespace.js ./src/mapboxgl/css/index.js && node ./node_modules/terser/bin/terser ./dist/mapboxgl/iclient-mapboxgl-es6.js --ecma 6 --comments /Copyright©/i -c -m -o ./dist/mapboxgl/iclient-mapboxgl-es6.min.js && cleancss -o ./dist/mapboxgl/iclient-mapboxgl.min.css ./dist/mapboxgl/iclient-mapboxgl.css",
2828
"release-classic-es6": "cross-env moduleVersion=es6 npm run deploy-classic ./src/classic/namespace.js && node ./node_modules/uglify-es/bin/uglifyjs ./dist/classic/iclient-classic-es6.js --ecma 6 --comments /Copyright©/i -c -m -o ./dist/classic/iclient-classic-es6.min.js",
2929
"deploy": "webpack --color",
3030
"deploy-leaflet": "webpack --config ./build/webpack.config.leaflet.js --color",
@@ -143,6 +143,7 @@
143143
"proj4": "2.8.0",
144144
"promise-polyfill": "8.2.3",
145145
"rbush": "^2.0.2",
146+
"terser-webpack-plugin": "^5.3.7",
146147
"three": "0.129.0",
147148
"util": "^0.12.4",
148149
"xlsx": "0.18.5",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy