mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
build config
This commit is contained in:
parent
7bfc4f4323
commit
fc572191cd
@ -10,4 +10,10 @@ config.output = {
|
|||||||
libraryTarget: 'umd'
|
libraryTarget: 'umd'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.externals = {
|
||||||
|
vue: 'Vue'
|
||||||
|
};
|
||||||
|
|
||||||
|
delete config.devtool;
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
10
build/webpack.build.min.js
vendored
10
build/webpack.build.min.js
vendored
@ -3,13 +3,15 @@ var webpack = require('webpack');
|
|||||||
|
|
||||||
config.output.filename = config.output.filename.replace(/\.js$/, '.min.js');
|
config.output.filename = config.output.filename.replace(/\.js$/, '.min.js');
|
||||||
|
|
||||||
delete config.devtool;
|
|
||||||
|
|
||||||
config.plugins = [
|
config.plugins = [
|
||||||
|
new webpack.LoaderOptionsPlugin({
|
||||||
|
minimize: true,
|
||||||
|
debug: false
|
||||||
|
}),
|
||||||
new webpack.optimize.UglifyJsPlugin({
|
new webpack.optimize.UglifyJsPlugin({
|
||||||
sourceMap: false,
|
comments: false,
|
||||||
drop_console: true,
|
|
||||||
compress: {
|
compress: {
|
||||||
|
drop_console: true,
|
||||||
warnings: false
|
warnings: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -88,8 +88,12 @@ if (process.env.NODE_ENV === 'production') {
|
|||||||
}),
|
}),
|
||||||
new ExtractTextPlugin(`yzvue_base_${version}_min.css`),
|
new ExtractTextPlugin(`yzvue_base_${version}_min.css`),
|
||||||
new webpack.optimize.UglifyJsPlugin({
|
new webpack.optimize.UglifyJsPlugin({
|
||||||
compress: {warnings: false},
|
compress: {
|
||||||
output: {comments: false},
|
warnings: false
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
comments: false
|
||||||
|
},
|
||||||
sourceMap: false
|
sourceMap: false
|
||||||
}),
|
}),
|
||||||
new webpack.LoaderOptionsPlugin({
|
new webpack.LoaderOptionsPlugin({
|
||||||
|
@ -52,6 +52,27 @@ export default {
|
|||||||
let { type, nativeType, size, disabled, loading, block } = this;
|
let { type, nativeType, size, disabled, loading, block } = this;
|
||||||
let Tag = this.tag;
|
let Tag = this.tag;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Tag
|
||||||
|
type={nativeType}
|
||||||
|
disabled={disabled}
|
||||||
|
class={[
|
||||||
|
'z-button',
|
||||||
|
'z-button--' + type,
|
||||||
|
'z-button--' + size,
|
||||||
|
{
|
||||||
|
'is-disabled': disabled,
|
||||||
|
'is-loading': loading,
|
||||||
|
'is-block': block
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
onClick={this.handleClick}
|
||||||
|
>
|
||||||
|
{
|
||||||
|
loading ? <i class="z-icon-loading"></i> : null
|
||||||
|
}
|
||||||
|
<span class="z-button-text">{this.$slots.default}</span>
|
||||||
|
</Tag>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user