-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
41 lines (36 loc) · 962 Bytes
/
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
module.exports = {
devtool: 'source-map',
entry: './src/main.js',
output: {
filename: './dist/[name].js',
pathinfo: true,
libraryTarget: 'commonjs2',
sourceMapFilename: '[file].map.js', // normally this is [file].map, but we need a js file, or it will be rejected by screeps server.
devtoolModuleFilenameTemplate: '[resource-path]',
},
target: 'node',
node: {
console: true,
global: true,
process: false,
Buffer: false,
__filename: false,
__dirname: false,
},
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: ['.js']
},
externals: [
{
// webpack will not try to rewrite require("main.js.map")
'main.js.map': './main.js.map',
},
],
module: {
rules: [
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{ test: /\.js$/, loader: 'source-map-loader', enforce: 'pre' },
],
},
};