-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
35 lines (34 loc) · 1.14 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
const path = require('path');
const process = require('process');
const webpack = require("webpack")
module.exports = {
entry: './background.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'background.bundle.js'
},
plugins: [
new webpack.DefinePlugin({
'process.env.BABEL_TYPES_8_BREAKING': JSON.stringify(process.env.BABEL_TYPES_8_BREAKING),
'process.platform': JSON.stringify(process.platform),
'process.env.TERM': JSON.stringify(process.env.TERM),
'process.env.BABEL_ENV': JSON.stringify(process.env.BABEL_ENV)
}),
new webpack.ProvidePlugin({
process: 'process/browser',
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
})
],
externals: ["fs"],
resolve: {
extensions: ['.js'],
fallback: {
"stream": require.resolve("stream-browserify"),
"path": require.resolve("path-browserify"),
"buffer": require.resolve("buffer"),
"assert": require.resolve("assert")
}
}
};