mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
[Build] revert site to webpack config (#3747)
This commit is contained in:
33
build/webpack.build.js
Normal file
33
build/webpack.build.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const path = require('path');
|
||||
const config = require('./webpack.dev.js');
|
||||
|
||||
const isMinify = process.argv.indexOf('-p') !== -1;
|
||||
|
||||
delete config.serve;
|
||||
|
||||
module.exports = Object.assign(config, {
|
||||
mode: 'production',
|
||||
entry: {
|
||||
vant: './es/index.js'
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, '../lib'),
|
||||
library: 'vant',
|
||||
libraryTarget: 'umd',
|
||||
filename: isMinify ? '[name].min.js' : '[name].js',
|
||||
umdNamedDefine: true,
|
||||
globalObject: 'this'
|
||||
},
|
||||
externals: {
|
||||
vue: {
|
||||
root: 'Vue',
|
||||
commonjs: 'vue',
|
||||
commonjs2: 'vue',
|
||||
amd: 'vue'
|
||||
}
|
||||
},
|
||||
performance: false,
|
||||
optimization: {
|
||||
minimize: isMinify
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user