2021-02-10 03:24:42 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
|
|
|
2024-12-09 01:43:18 +00:00
|
|
|
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
|
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
|
|
const path = require("node:path");
|
2019-04-21 18:30:00 +00:00
|
|
|
|
2021-02-10 03:24:42 +00:00
|
|
|
/** @type {import('webpack').Configuration} */
|
2019-04-21 18:30:00 +00:00
|
|
|
module.exports = {
|
2024-12-09 01:43:18 +00:00
|
|
|
target: "node",
|
|
|
|
entry: "./src/extension.ts",
|
2019-04-21 18:30:00 +00:00
|
|
|
output: {
|
2024-12-09 01:43:18 +00:00
|
|
|
filename: "extension.js",
|
|
|
|
libraryTarget: "commonjs2",
|
|
|
|
path: path.resolve(process.cwd(), "dist"),
|
2019-04-21 18:30:00 +00:00
|
|
|
},
|
2024-12-09 01:43:18 +00:00
|
|
|
devtool: "source-map",
|
2019-04-21 18:30:00 +00:00
|
|
|
externals: {
|
2024-12-09 01:43:18 +00:00
|
|
|
vscode: "commonjs vscode",
|
2019-04-21 18:30:00 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
2024-12-09 01:43:18 +00:00
|
|
|
extensions: [".ts", ".js", ".json"],
|
2019-04-21 18:30:00 +00:00
|
|
|
},
|
2019-09-22 16:56:19 +00:00
|
|
|
plugins: [new CleanWebpackPlugin()],
|
2019-04-21 18:30:00 +00:00
|
|
|
optimization: {
|
2020-12-20 11:16:48 +00:00
|
|
|
minimize: true,
|
2019-04-21 18:30:00 +00:00
|
|
|
minimizer: [
|
|
|
|
new TerserPlugin({
|
2019-08-03 12:16:17 +00:00
|
|
|
extractComments: true,
|
2019-04-21 18:30:00 +00:00
|
|
|
terserOptions: {
|
2020-12-20 11:16:48 +00:00
|
|
|
output: {
|
|
|
|
comments: false,
|
|
|
|
},
|
2019-08-03 12:16:17 +00:00
|
|
|
mangle: false,
|
|
|
|
keep_classnames: true,
|
2019-09-22 16:56:19 +00:00
|
|
|
keep_fnames: true,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
2019-04-21 18:30:00 +00:00
|
|
|
},
|
|
|
|
module: {
|
2019-09-22 16:56:19 +00:00
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.ts$/,
|
2024-12-09 01:43:18 +00:00
|
|
|
use: "ts-loader",
|
2019-09-22 16:56:19 +00:00
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2019-04-21 18:30:00 +00:00
|
|
|
};
|