-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.renderer.config.js
49 lines (44 loc) · 1.11 KB
/
webpack.renderer.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
45
46
47
48
49
const rules = require('./webpack.rules');
const webpack = require('webpack');
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const assets = [ 'model' ]; // folder exposed by static:// scheme
const copyPlugin = new CopyWebpackPlugin(
{
patterns: assets.map(asset => ({
from: path.resolve(__dirname, 'src', asset),
to: path.resolve(__dirname, '.webpack/renderer', asset)
}))
}
);
rules.push({
test: /\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
});
new webpack.DefinePlugin({
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false
})
module.exports = {
resolve: {
alias: {
'vue': '@vue/runtime-dom',
'vue': 'vue/dist/vue.esm-bundler',
'@': path.join(__dirname, 'src')
}
},
// Put your normal webpack config below here
module: {
rules,
},
plugins: [
new webpack.DefinePlugin({
"__VUE_OPTIONS_API__": true,
"__VUE_PROD_DEVTOOLS__": false,
}),
new VueLoaderPlugin(),
copyPlugin,
],
devtool: 'source-map',
};