From 107fb5a524086280fd065ec1dbfff4b81f022424 Mon Sep 17 00:00:00 2001 From: Boiao Ch Date: Wed, 26 Aug 2020 18:12:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(build):=20=E4=BF=AE=E5=A4=8D=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=89=93=E5=8C=85=E5=90=8E=E5=85=A5=E5=8F=A3=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 24 ++++++++++++------------ package.json | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config/index.js b/config/index.js index 8b4e8ed54..bc3aa7939 100644 --- a/config/index.js +++ b/config/index.js @@ -9,12 +9,10 @@ const config = { designWidth: 750, sourceRoot: 'src', outputRoot: isBuildComponent ? 'dist' : `dist/${process.env.TARO_ENV}`, - plugins: {}, + plugins: ['@tarojs/plugin-sass', '@tarojs/plugin-uglify'], babel: { sourceMap: true, - presets: [ - 'env' - ], + presets: ['env'], plugins: [ 'transform-class-properties', 'transform-decorators-legacy', @@ -23,7 +21,7 @@ const config = { }, defineConstants: {}, alias: { - 'taro-ui': path.resolve(__dirname, '../src/ui.ts'), + 'taro-ui': path.resolve(__dirname, '../src/ui.ts') }, mini: {}, h5: { @@ -33,7 +31,7 @@ const config = { enable: true } } - }, + } } if (isBuildComponent) { @@ -57,22 +55,24 @@ if (isBuildComponent) { classnames: 'commonjs2 classnames', '@tarojs/components': 'commonjs2 @tarojs/components', '@tarojs/taro-h5': 'commonjs2 @tarojs/taro-h5', - 'weui': 'commonjs2 weui' + weui: 'commonjs2 weui' }, plugin: { extractCSS: { plugin: MiniCssExtractPlugin, - args: [{ - filename: 'css/index.css', - chunkFilename: 'css/[id].css' - }] + args: [ + { + filename: 'css/index.css', + chunkFilename: 'css/[id].css' + } + ] } } }) } } -module.exports = function (merge) { +module.exports = function(merge) { if (process.env.NODE_ENV === 'development') { return merge({}, config, require('./dev')) } diff --git a/package.json b/package.json index 5b582a31d..be8cbe39a 100644 --- a/package.json +++ b/package.json @@ -199,7 +199,7 @@ "build:h5": "taro build --type h5", "build:swan": "taro build --type swan", "build:alipay": "taro build --type alipay", - "build:component": "cross-env TARO_BUILD_TYPE=component taro build --ui", + "build:component": "cross-env TARO_BUILD_TYPE=component taro build --ui --uiIndex ui", "build:h5-static": "yarn run build:h5 && node ./build/build-static", "build:doc": "yarn run build:h5-static && node ./build/build-docs", "prepublishOnly": "yarn run clean && yarn run build:component", @@ -234,7 +234,7 @@ "@tarojs/plugin-babel": "^2.0.3", "@tarojs/plugin-csso": "^2.0.3", "@tarojs/plugin-sass": "^2.0.3", - "@tarojs/plugin-uglifyjs": "^2.0.3", + "@tarojs/plugin-uglify": "^2.2.10", "@tarojs/router": "^2.0.3", "@tarojs/taro": "^2.0.3", "@tarojs/taro-alipay": "^2.0.3",