From fc572191cd5b0a6121dad61160c0aac8eb9c6eca Mon Sep 17 00:00:00 2001 From: cookfront Date: Sun, 26 Feb 2017 13:34:49 +0800 Subject: [PATCH] build config --- build/webpack.build.js | 6 ++++++ build/webpack.build.min.js | 10 ++++++---- build/webpack.config.js | 8 ++++++-- packages/button/src/button.js | 23 ++++++++++++++++++++++- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/build/webpack.build.js b/build/webpack.build.js index 49223cc98..7963aad45 100644 --- a/build/webpack.build.js +++ b/build/webpack.build.js @@ -10,4 +10,10 @@ config.output = { libraryTarget: 'umd' }; +config.externals = { + vue: 'Vue' +}; + +delete config.devtool; + module.exports = config; diff --git a/build/webpack.build.min.js b/build/webpack.build.min.js index b3521675c..be17f3f93 100644 --- a/build/webpack.build.min.js +++ b/build/webpack.build.min.js @@ -3,13 +3,15 @@ var webpack = require('webpack'); config.output.filename = config.output.filename.replace(/\.js$/, '.min.js'); -delete config.devtool; - config.plugins = [ + new webpack.LoaderOptionsPlugin({ + minimize: true, + debug: false + }), new webpack.optimize.UglifyJsPlugin({ - sourceMap: false, - drop_console: true, + comments: false, compress: { + drop_console: true, warnings: false } }) diff --git a/build/webpack.config.js b/build/webpack.config.js index 4a626fbe0..111fe99b4 100644 --- a/build/webpack.config.js +++ b/build/webpack.config.js @@ -88,8 +88,12 @@ if (process.env.NODE_ENV === 'production') { }), new ExtractTextPlugin(`yzvue_base_${version}_min.css`), new webpack.optimize.UglifyJsPlugin({ - compress: {warnings: false}, - output: {comments: false}, + compress: { + warnings: false + }, + output: { + comments: false + }, sourceMap: false }), new webpack.LoaderOptionsPlugin({ diff --git a/packages/button/src/button.js b/packages/button/src/button.js index 1ebf96e23..fa62244c4 100644 --- a/packages/button/src/button.js +++ b/packages/button/src/button.js @@ -52,6 +52,27 @@ export default { let { type, nativeType, size, disabled, loading, block } = this; let Tag = this.tag; - + return ( + + { + loading ? : null + } + {this.$slots.default} + + ); } };