forked from joaompfp/hermes-vscode
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
45 lines (44 loc) · 1.15 KB
/
Copy pathwebpack.config.js
File metadata and controls
45 lines (44 loc) · 1.15 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
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
/** @type {import('webpack').Configuration[]} */
module.exports = [
// Extension host bundle (Node.js)
{
name: 'extension',
target: 'node',
entry: './src/extension.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'extension.js',
libraryTarget: 'commonjs2',
},
externals: { vscode: 'commonjs vscode' },
module: {
rules: [{ test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/ }],
},
resolve: { extensions: ['.ts', '.js'] },
},
// Webview bundle (browser) — uses its own tsconfig with DOM lib
{
name: 'webview',
target: 'web',
entry: './src/webview/main.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'webview.js',
},
module: {
rules: [
{
test: /\.ts$/,
use: {
loader: 'ts-loader',
options: { configFile: path.resolve(__dirname, 'src/webview/tsconfig.json') },
},
exclude: /node_modules/,
},
],
},
resolve: { extensions: ['.ts', '.js'] },
},
];