-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathwebpack.config-spec.js
More file actions
30 lines (29 loc) · 918 Bytes
/
webpack.config-spec.js
File metadata and controls
30 lines (29 loc) · 918 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
const path = require("path")
const nodeExternals = require("webpack-node-externals")
const bundleIndexPath = path.resolve("./src/bundle.js")
module.exports = {
entry: {
d3ComboChart: bundleIndexPath
},
output: {
// use absolute paths in sourcemaps (important for debugging via IDE)
devtoolModuleFilenameTemplate: "[absolute-resource-path]",
devtoolFallbackModuleFilenameTemplate: "[absolute-resource-path]?[hash]"
},
target: "node", // webpack should compile node compatible code
externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
devtool: "inline-cheap-module-source-map",
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|doc|dist|dev)/,
use: {
loader: "babel-loader"
}
},
{test: /\.scss$/, loader: "null-loader"},
{test: /\.css$/, loader: "null-loader"}
]
}
}