-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
46 lines (45 loc) · 1.3 KB
/
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
42
43
44
45
46
// webpack.config.js
const path = require('path')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
module.exports = {
target: 'node', // Ensure the code is compiled for Node.js
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
entry: './src/extension.ts', // Your entry file
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'extension.js',
libraryTarget: 'commonjs2'
},
externals: {
vscode: 'commonjs vscode' // Exclude the vscode module
},
resolve: {
extensions: ['.ts', '.js'],
fallback: {
fs: false,
path: require.resolve('path-browserify'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
assert: require.resolve('assert/'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
os: require.resolve('os-browserify/browser'),
url: require.resolve('url/'),
zlib: require.resolve('browserify-zlib')
}
},
plugins: [new NodePolyfillPlugin()],
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader',
options: {
compilerOptions: {
module: 'es6'
}
}
}
]
}
}