-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathwebpack.js
52 lines (49 loc) · 1.32 KB
/
webpack.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
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const path = require('path')
module.exports = args => {
const outputDir =
args && args.env && args.env == 'development' ? 'dev' : 'dist'
const manifestFile =
args && args.env && args.env == 'development'
? './manifest.dev.json'
: './manifest.dist.json'
const bundleType =
args && args.env && args.env == 'development' ? 'dev' : 'dist'
return merge(common, {
devtool: 'inline-source-map',
output: {
path: path.resolve(__dirname, outputDir),
filename: `${bundleType}.gmailquicklinks.bundle.js`
},
plugins: [
new CopyWebpackPlugin([
{
from: manifestFile,
to: './manifest.json'
},
{
from: './src/assets/icon16.png',
to: './assets/icon16.png'
},
{
from: './src/assets/icon48.png',
to: './assets/icon48.png'
},
{
from: './src/default.css',
to: './default.css'
},
{
from: './node_modules/react/dist/react.js',
to: './react.js'
},
{
from: './node_modules/react-dom/dist/react-dom.js',
to: './react-dom.js'
}
])
]
})
}