[Build] use vue-cli to build site (#3734)
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
const path = require('path');
|
||||
|
||||
const isMinify = process.argv.indexOf('-p') !== -1;
|
||||
|
||||
module.exports = {
|
||||
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'
|
||||
}
|
||||
},
|
||||
optimization: {
|
||||
minimize: isMinify
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.ts', '.tsx']
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|ts|tsx)$/,
|
||||
exclude: /node_modules/,
|
||||
use: 'babel-loader'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user