-
-
Notifications
You must be signed in to change notification settings - Fork 99
/
webpack.config.js
Latest commit
33 lines (32 loc) · 769 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module.exports = env => {
const isV3 =!!env.v3
const loaderName = `vue-loader${isV3? '': '-old'}`;
const { VueLoaderPlugin } = require(loaderName);
return {
mode: process.env.NODE_ENV,
entry: [ "./src/vue-wait.js" ],
output: {
library: "VueWait",
libraryTarget: "umd",
globalObject: 'typeof self!== \'undefined\'? self: this',
filename: `vue-wait${isV3? '-next': '-v2'}.js`
},
externals: { vue: 'vue' },
module: {
rules: [
{
test: /\.vue$/,
loader: loaderName
},
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
}
]
},
plugins: [new VueLoaderPlugin()]
}
};