-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathwebpack.config.js
56 lines (50 loc) · 1.14 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
const path = require('path')
const CopyPlugin = require('copy-webpack-plugin')
let destFolder = 'dist'
if (process.env.NODE_ENV === 'production') destFolder = 'release/com.pedrofuentes.ical.sdPlugin'
const mainConfig = {
entry: './src/js/main.js',
output: {
filename: 'js/main.js',
path: path.resolve(__dirname, destFolder)
},
plugins: [
new CopyPlugin({
patterns: [
{ from: './src/manifest.json', to: '' },
{ from: './src/app.html', to: '' },
{ from: './src/assets', to: 'assets' }
]
})
]
}
const piConfig = {
entry: './src/js/pi.js',
output: {
filename: 'js/pi.js',
path: path.resolve(__dirname, destFolder)
},
plugins: [
new CopyPlugin({
patterns: [
{ from: './src/pi.html', to: '' },
{ from: './src/css', to: 'css' }
]
})
]
}
const setupConfig = {
entry: './src/js/setup.js',
output: {
filename: 'js/setup.js',
path: path.resolve(__dirname, destFolder)
},
plugins: [
new CopyPlugin({
patterns: [
{ from: './src/setup.html', to: '' }
]
})
]
}
module.exports = [mainConfig, piConfig, setupConfig]