forked from uffou/MixCloud-Play
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
61 lines (59 loc) · 1.28 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const path = require('path');
const { version: electronVersion } = require(`electron/package.json`);
const CopyPlugin = require('copy-webpack-plugin');
module.exports = [{
entry: './src/preferences/renderer',
devtool: 'source-map',
output: {
path: path.join(__dirname, 'build', 'preferences'),
filename: 'renderer.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-env', {
targets: {electron: electronVersion}
}],
'@babel/preset-react'
],
plugins: [
["@babel/plugin-proposal-decorators", { legacy: true }],
'@babel/plugin-proposal-function-bind',
['@babel/plugin-proposal-class-properties', { loose: true }]
]
}
}
}
]
}
}, {
entry: './src/blank.js',
output: {
path: path.join(__dirname, 'build'),
filename: 'blank.js'
},
plugins: [
new CopyPlugin([
{
from: './src/img/',
to: 'img/'
},
{
from: './src/preferences/index.html',
to: 'preferences/index.html'
},
{ from: './src/main.css' },
{ from: './src/index.html' },
{ from: './src/main.js' },
{ from: './src/menu.js' },
{ from: './src/preload.js' },
{ from: './src/renderer.js' },
])
]
}]