-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
webpack.config.js
50 lines (49 loc) · 1.36 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
const webpack = require('webpack');
const path = require('path');
module.exports = (env, argv) => ({
entry: {
background: './src/background.ts',
content_script: './src/content_script.ts',
toolbarPopup: './src/popup.ts',
options: './src/options.ts',
credentialSelector: './src/credentialSelector.ts',
},
output: {
path: path.resolve(__dirname, 'dist/js'),
filename: '[name].js',
},
module: {
rules: [
{
exclude: /node_modules/,
test: /\.tsx?$/,
loader: 'ts-loader'
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
fallback: {
'crypto': false
},
},
plugins: [
new webpack.DefinePlugin({
DEBUG: (argv.mode!=='production'),
VERSION: JSON.stringify(require("./dist/manifest.json").version),
EXTENSIONNAME: JSON.stringify(require('./dist/manifest.json').name),
}),
],
devtool: argv.mode!=='production'?'inline-source-map':undefined,
performance: {
hints: false,
},
stats: {
builtAt: true,
chunks: false,
chunkModules: false,
chunkOrigins: false,
modules: false,
entrypoints: false,
},
});