You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
835 B
44 lines
835 B
![]()
1 week ago
|
const path = require('path')
|
||
|
const { VueLoaderPlugin } = require('vue-loader')
|
||
|
|
||
|
module.exports = {
|
||
|
mode: 'production',
|
||
|
entry: {
|
||
|
'my-components': './packages/index.js'
|
||
|
},
|
||
|
output: {
|
||
|
path: path.resolve(__dirname, '../dist'),
|
||
|
filename: '[name].umd.js',
|
||
|
library: 'MyComponents',
|
||
|
libraryTarget: 'umd',
|
||
|
umdNamedDefine: true,
|
||
|
globalObject: 'this'
|
||
|
},
|
||
|
module: {
|
||
|
rules: [
|
||
|
{
|
||
|
test: /\.vue$/,
|
||
|
loader: 'vue-loader'
|
||
|
},
|
||
|
{
|
||
|
test: /\.css$/,
|
||
|
use: ['style-loader', 'css-loader']
|
||
|
},
|
||
|
{
|
||
|
test: /\.scss$/,
|
||
|
use: ['style-loader', 'css-loader', 'sass-loader']
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
plugins: [
|
||
|
new VueLoaderPlugin()
|
||
|
],
|
||
|
externals: {
|
||
|
vue: {
|
||
|
root: 'Vue',
|
||
|
commonjs: 'vue',
|
||
|
commonjs2: 'vue',
|
||
|
amd: 'vue'
|
||
|
}
|
||
|
}
|
||
|
}
|