-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
38 lines (35 loc) · 905 Bytes
/
webpack.config.ts
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
import * as path from "path";
import * as webpack from "webpack";
const extConfig: webpack.Configuration = {
target: "node",
entry: "./src/extension.ts",
output: {
filename: "extension.js",
libraryTarget: "commonjs2",
path: path.resolve(__dirname, "out"),
},
resolve: { extensions: [".ts", ".js"] },
module: { rules: [{ test: /\.ts$/, loader: "ts-loader" }] },
externals: { vscode: "vscode" },
};
const webviewConfig: webpack.Configuration = {
target: "web",
entry: "./src/webview/index.tsx",
output: {
filename: "[name].wv.js",
path: path.resolve(__dirname, "out"),
},
resolve: {
extensions: [".js", ".ts", ".tsx"],
},
module: {
rules: [
{ test: /\.tsx?$/, use: ["babel-loader", "ts-loader"] },
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
],
},
};
export default [webviewConfig, extConfig];