-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathwebpack.config.js
More file actions
42 lines (37 loc) · 832 Bytes
/
webpack.config.js
File metadata and controls
42 lines (37 loc) · 832 Bytes
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
"use strict"
const path = require("path")
const webpack = require("webpack")
module.exports = (env, argv) => {
let config = {
mode: argv.mode,
entry: {
"service-worker": './src/service-worker.ts',
"popup": './src/popup.ts',
"options": './src/options.ts',
"content": './src/content.ts',
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
node: { global: false },
cache: true,
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
path: `${path.resolve(__dirname, 'extension/js')}`,
publicPath: '/',
filename: "[name].js"
},
}
if (argv.mode !== 'production' ) {
config.devtool = 'inline-source-map'
}
return config
}