-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebpack.config.ts
42 lines (38 loc) · 1.06 KB
/
webpack.config.ts
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
import * as Path from 'path';
import * as webpack from 'webpack';
const config: webpack.Configuration = {
context: __dirname,
entry: './out/npm_lifecycle_postinstall',
output: {
path: __dirname + '/dist',
filename: 'npm_lifecycle_postinstall.js'
},
target: 'node',
mode: 'production',
optimization: {
minimize: false
},
devtool: 'source-map',
externals: [
function(context, request, callback) {
const localExternals = [
'./out/buildTags.json',
'./out/__root'
];
for(const localExternal of localExternals) {
if(request[0] === '.' && Path.resolve(context, request) === Path.resolve(__dirname, localExternal)) {
return callback(null, 'commonjs ' + request);
}
}
callback(null, undefined);
},
{tar: 'commonjs tar'}
],
module: {
rules: [{
test: /\.js$/,
use: ['source-map-loader']
}]
},
};
export = config;