-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
45 lines (42 loc) · 1005 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
42
43
44
45
// @ts-check
const path = require('node:path')
const webpack = require('webpack')
/**@type {import('webpack').Configuration}*/
module.exports = {
entry: {
extension: './src/extension.ts',
'test/suite/index': './src/test/suite/index.web.ts',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
libraryTarget: 'commonjs',
clean: true,
},
target: 'webworker',
mode: 'none',
resolve: {
extensions: ['.ts', '.js'],
fallback: {
assert: require.resolve('assert'),
stream: false,
},
},
externals: {
vscode: 'commonjs vscode',
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [{ loader: 'ts-loader' }],
},
],
},
devtool: 'nosources-source-map',
plugins: [new webpack.ProvidePlugin({ process: 'process/browser' })],
performance: {
assetFilter: (assetFilename) => !/\.map$/.test(assetFilename) && !assetFilename.startsWith('test/'),
},
}