-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.worker.config.js
49 lines (47 loc) · 1.24 KB
/
webpack.worker.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
42
43
44
45
46
47
48
49
// tslint:disable:no-var-requires
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const path = require('path');
const tsConfigPath = path.join(__dirname, './tsconfig.json');
const distDir = path.join(__dirname, './dist');
module.exports = {
entry: require.resolve('@opensumi/ide-extension/lib/hosted/worker.host-preload.js'),
output: {
filename: 'worker.host.js',
path: distDir,
},
target: 'webworker',
node: {
net: 'empty',
},
mode: 'production',
devtool: 'none',
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json', '.less'],
plugins: [new TsconfigPathsPlugin({
configFile: tsConfigPath,
})],
},
module: {
// https://github.com/webpack/webpack/issues/196#issuecomment-397606728
exprContextCritical: false,
rules: [{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
configFile: tsConfigPath,
happyPackMode: true,
transpileOnly: true,
compilerOptions: {
target: 'es2017',
},
}
},
],
},
resolveLoader: {
modules: [path.join(__dirname, '../node_modules')],
extensions: ['.ts', '.tsx', '.js', '.json', '.less'],
mainFields: ['loader', 'main'],
moduleExtensions: ['-loader'],
},
};