forked from damien122/Autoit-Visual-Studio-Extension
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (52 loc) · 1.47 KB
/
webpack.config.js
File metadata and controls
54 lines (52 loc) · 1.47 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 path = require('path');
/** @type {import('webpack').Configuration} */
const config = {
target: 'node',
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
entry: './src/extension.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'extension.js',
library: { type: 'commonjs2' },
devtoolModuleFilenameTemplate: '../[resource-path]',
clean: true,
},
// Use inline source maps in development (best for VS Code extension debugging),
// and external source maps in production.
devtool: process.env.NODE_ENV === 'production' ? 'source-map' : 'inline-source-map',
externals: {
vscode: 'commonjs vscode',
'jsonc-parser': 'commonjs jsonc-parser',
},
resolve: {
extensions: ['.ts', '.js', '.json'],
mainFields: ['main', 'module'],
},
module: {
rules: [
{
test: /.(js|ts)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
configFile: path.resolve(__dirname, 'babel.config.json'),
cacheDirectory: true,
cacheCompression: false,
},
},
},
],
},
optimization: {
minimize: process.env.NODE_ENV === 'production',
usedExports: true,
sideEffects: false,
splitChunks: false,
concatenateModules: true,
},
performance: { hints: false },
stats: { errorDetails: true, colors: true },
infrastructureLogging: { level: 'warn' },
};
module.exports = config;