-
Notifications
You must be signed in to change notification settings - Fork 3
/
vue.config.js
44 lines (43 loc) · 1.08 KB
/
vue.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
34
35
36
37
38
39
40
41
42
43
44
const webpack = require('webpack');
const pkg = require('./package.json');
module.exports = {
css: {
loaderOptions: {
css: {
// localIdentName: `${pkg.libname}[name]_[local]_[hash:base64:5]`,
},
},
},
lintOnSave: false,
configureWebpack: (/* config */) => {
const customConfig = {
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jquery: 'jquery',
jQuery: 'jquery',
'window.jquery': 'jquery',
'window.jQuery': 'jquery',
'window.$': 'jquery',
}),
new webpack.DefinePlugin({
LIBNAME: JSON.stringify(pkg.libname),
}),
],
};
// config for lib
if (process.env.VUE_CLI_BUILD_TARGET === 'lib') {
// set external modules so they won't get bundled with the lib
customConfig.externals = [
'bootbox',
'bootstrap',
'font-awesome',
'jquery',
'vue',
];
}
// config parameter can be mutated
// or a new object (to be used with webpack-merge) returned
return customConfig;
},
};