/
webpack.config.js
16 lines (15 loc) · 1.21 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ts-check
"use strict";
const path = require("path");
/**@type {import('webpack').Configuration}*/
const config = {
target: "node", // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
mode: "none", // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
entry: "./src/extension.ts", // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output: { path: path.resolve(__dirname, "dist"), filename: "extension.js", libraryTarget: "commonjs2" }, // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
devtool: "nosources-source-map",
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/
resolve: { extensions: [".ts", ".js"] }, // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
module: { rules: [{ test: /\.ts$/, exclude: /node_modules/, use: [{ loader: "ts-loader" }] }] },
};
module.exports = config;