From 49ec69c63cdc5a5a85994e98751ef347608df712 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 21 Oct 2019 20:26:09 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=89=93=E5=8C=85=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/postbuild/postbuild.js | 7 +++++-- webpack/webpack.prod.js | 25 ++++++++++++++----------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/lib/postbuild/postbuild.js b/lib/postbuild/postbuild.js index 98dcad2d7..8ec0397be 100644 --- a/lib/postbuild/postbuild.js +++ b/lib/postbuild/postbuild.js @@ -15,7 +15,9 @@ function unionJs(filenames) { ); }); - concat.add(null, `//# sourceMappingURL=${filename}.map`); + const filenameParts = filename.split("/"); + + concat.add(null, `//# sourceMappingURL=${filenameParts[filenameParts.length - 1]}.map`); var concatenatedContent = concat.content; var sourceMapForContent = concat.sourceMap; @@ -33,4 +35,5 @@ unionJs(["bundle.min.js", "fineui.typescript.js"]); unionJs(["bundle.ie.min.js", "fineui.typescript.ie.js"]); unionJs(["fineui.min.js", "fineui.typescript.js"]); unionJs(["fineui.ie.min.js", "fineui.typescript.ie.js"]); -// unionJs(["bundle.min.js", "fineui.typescript.js"]); +unionJs(["2.0/fineui.min.js", "fineui.typescript.js"]); +unionJs(["2.0/fineui.ie.min.js", "fineui.typescript.ie.js"]); diff --git a/webpack/webpack.prod.js b/webpack/webpack.prod.js index c3893a777..1c8458ded 100644 --- a/webpack/webpack.prod.js +++ b/webpack/webpack.prod.js @@ -13,6 +13,20 @@ const common = require("./webpack.common.js"); module.exports = merge.smart(common, { mode: "production", + optimization: { + minimizer: [ + new UglifyJsPlugin({ + parallel: true, + sourceMap: true, + uglifyOptions: { + ie8: true, + output: { + comments: false, + }, + } + }) + ] + }, devtool: "hidden-source-map", @@ -26,17 +40,6 @@ module.exports = merge.smart(common, { path: dirs.DEST, filename: "fineui.typescript.css", }), - new UglifyJsPlugin({ - test: /\.js(\?.*)?$/i, - parallel: true, - sourceMap: true, - uglifyOptions: { - ie8: true, - output: { - comments: false, - }, - }, - }), new webpack.BannerPlugin({ banner: `time: ${new Date().toLocaleString()}`, }),