-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
40 lines (37 loc) · 902 Bytes
/
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
const path = require('path');
const DefinePlugin = require('webpack/lib/DefinePlugin');
const env = process.env.NODE_ENV === 'production' ? 'production' : 'development';
const config = {
mode: 'none',
entry: {
'background': './src/background.ts',
'index': './src/index.tsx',
},
output: {
path: path.join(__dirname, 'build'),
filename: '[name].js'
},
resolve: {
modules: [
path.join(__dirname, 'src'),
'node_modules'
],
extensions: ['.ts', '.tsx', '.js', '.json']
},
module: {
rules: [
{
test: /\.tsx?$/,
use: [
'ts-loader'
]
}
]
},
plugins: [
new DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(env)
})
]
};
module.exports = config;