2020-09-15 16:10:32 +08:00
|
|
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
|
|
const path = require('path')
|
|
|
|
const { VueLoaderPlugin } = require('vue-loader')
|
2020-11-10 14:24:09 +08:00
|
|
|
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
2020-09-15 16:10:32 +08:00
|
|
|
|
|
|
|
module.exports = {
|
2020-11-10 14:24:09 +08:00
|
|
|
mode: 'development',
|
2020-09-15 17:12:16 +08:00
|
|
|
entry: path.resolve(__dirname, '../packages/element-plus/index.ts'),
|
2020-09-15 16:10:32 +08:00
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, '../lib'),
|
|
|
|
publicPath: '/',
|
2020-09-15 17:12:16 +08:00
|
|
|
filename: 'index.js',
|
|
|
|
libraryTarget: 'umd',
|
2020-10-16 14:33:43 +08:00
|
|
|
library: 'ElementPlus',
|
2020-09-15 17:12:16 +08:00
|
|
|
umdNamedDefine: true,
|
2020-11-05 19:11:04 +08:00
|
|
|
globalObject: 'typeof self !== \'undefined\' ? self : this',
|
2020-09-15 16:10:32 +08:00
|
|
|
},
|
|
|
|
stats: 'verbose',
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.vue$/,
|
|
|
|
use: 'vue-loader',
|
|
|
|
},
|
|
|
|
{
|
2020-11-10 14:24:09 +08:00
|
|
|
test: /\.(ts|js)x?$/,
|
2020-09-15 16:10:32 +08:00
|
|
|
exclude: /node_modules/,
|
2020-11-10 14:24:09 +08:00
|
|
|
loader: 'babel-loader',
|
2020-09-15 16:10:32 +08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
2020-10-21 15:50:39 +08:00
|
|
|
extensions: ['.ts', '.tsx', '.js', '.json'],
|
2020-09-15 16:10:32 +08:00
|
|
|
},
|
2020-11-18 22:15:52 +08:00
|
|
|
externals: [
|
|
|
|
{
|
|
|
|
vue: {
|
|
|
|
root: 'Vue',
|
|
|
|
commonjs: 'vue',
|
|
|
|
commonjs2: 'vue',
|
|
|
|
amd: 'vue',
|
|
|
|
},
|
2020-10-16 14:14:36 +08:00
|
|
|
},
|
2020-11-18 22:15:52 +08:00
|
|
|
/^dayjs.*/,
|
|
|
|
],
|
2020-09-15 16:10:32 +08:00
|
|
|
plugins: [
|
|
|
|
new VueLoaderPlugin(),
|
2020-11-10 14:24:09 +08:00
|
|
|
// new BundleAnalyzerPlugin(),
|
2020-09-15 16:10:32 +08:00
|
|
|
],
|
|
|
|
}
|