-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathwebpack.test.js
38 lines (37 loc) · 1.13 KB
/
webpack.test.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
const nodeExternals = require("webpack-node-externals")
const path = require("path")
module.exports = {
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
exclude: /node_modules/,
},
]
},
entry: {
processTransport: path.resolve(__dirname,"tests/processTransport.ts"), // mochapack doesn't actually read this so it's fine
worker: path.resolve(__dirname,"tests/worker.ts")
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "dist"),
devtoolModuleFilenameTemplate(info){
return "/home"+info.resourcePath.substring(8)
},
devtoolFallbackModuleFilenameTemplate(info){
return "/home"+info.resourcePath.substring(8)+"?"+info.hash
},
},
resolve: {
extensions: [".ts", ".js"],
},
stats:{
errorDetails: true
},
mode: "development",
target: "node",
externals: [nodeExternals()], // in order to ignore all modules in node_modules folder from bundling
devtool:"inline-cheap-module-source-map",
}