-
-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathwebpack.config.js
More file actions
50 lines (47 loc) · 1.18 KB
/
webpack.config.js
File metadata and controls
50 lines (47 loc) · 1.18 KB
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
var path = require("path");
var webpack = require("webpack");
module.exports = {
devtool: "source-map",
entry: ["./src/App.js"],
output: {
path: __dirname,
filename: "bundle.js",
},
module: {
loaders: [
{
test: /\.jsx$/,
loader: "babel",
},
],
},
externals: {
react: "React",
"react-dom": "ReactDOM",
},
rules:[
{
test: /\.js$/,
enforce: 'pre',
use: [
{
//needed to chain sourcemaps. see: https://webpack.js.org/loaders/source-map-loader/
loader: 'source-map-loader',
options: {
presets: ['@babel/preset-react', '@babel/preset-env'],
filterSourceMappingUrl: (url, resourcePath) => {
// console.log({ url, resourcePath }) example:
// {
// url: 'index.js.map',
// resourcePath: '/repos/xlib-wsl/common/temp/node_modules/.pnpm/https-proxy-agent@5.0.0/node_modules/https-proxy-agent/dist/index.js'
// }
if (/.*\/node_modules\/.*/.test(resourcePath)) {
return false
}
return true
}
}
}],
},
]
};