-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.ts
34 lines (29 loc) · 919 Bytes
/
webpack.config.ts
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
import webpack from 'webpack';
import path from 'path';
import WebpackCopyPlugin from 'copy-webpack-plugin';
const browser = process.env.BROWSER as string;
const env = (process.env.NODE_ENV || 'development') as string;
const config: webpack.Configuration = {
devtool: env === 'development' ? 'inline-source-map' : false,
context: path.resolve(__dirname, 'src'),
entry: {
'scripts/content_script_vrc': './scripts/content_script_vrc.ts',
},
output: {
path: path.resolve(__dirname, 'dist', browser, env),
},
module: {
rules: [
{ test: /\.tsx?$/, use: 'ts-loader' },
],
},
plugins: [
new WebpackCopyPlugin({
patterns: [{
from: browser === 'firefox' ? 'manifest_v2.json' : 'manifest.json',
to: './manifest.json',
}, './img/*.png'],
}),
]
};
export default config;