-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (51 loc) · 1.78 KB
/
webpack.config.js
File metadata and controls
54 lines (51 loc) · 1.78 KB
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
50
51
52
53
54
const { join } = require('path');
const { cwd } = require('process');
const filterWranPlugin = require('./plugins/FilterCriticalWran');
const OUT_PATH = join(cwd(), 'out');
/** @type {import('webpack').Configuration} */
const webpackConfig = {
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
devtool: 'source-map',
entry: join(__dirname, './src/extension.ts'),
resolve: {
alias: {
commands: join(__dirname, './src/commands'),
utils: join(__dirname, './src/utils'),
types: join(__dirname, './src/types'),
constants: join(__dirname, './src/constants'),
providers: join(__dirname, './src/providers'),
models: join(__dirname, './src/models'),
decorators: join(__dirname, './src/decorators'),
tasks: join(__dirname, './src/tasks'),
},
extensions: [".ts", 'mjs', '.js', ".json"]
},
externals: {
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
// modules added here also need to be added in the .vscodeignore file
},
output: {
filename: 'extension.js',
path: OUT_PATH,
libraryTarget: 'commonjs2'
},
module: {
rules: [
{
test: /\.(ts|js|json)$/,
loader: 'ts-loader',
exclude: /node_modules/,
},
]
},
plugins: [
// new DllPlugin({ format: true, path: OUT_PATH }),
filterWranPlugin,
],
cache: {
/** 文件编译缓存加速 这个真的顶 d=====( ̄▽ ̄*)b */
type: 'filesystem'
},
};
module.exports = [webpackConfig];