discord-vscode/webpack.config.js

51 lines
1 KiB
JavaScript
Raw Normal View History

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");
2021-02-10 03:24:42 +00:00
/** @type {import('webpack').Configuration} */
module.exports = {
2024-12-09 01:43:18 +00:00
target: "node",
entry: "./src/extension.ts",
output: {
2024-12-09 01:43:18 +00:00
filename: "extension.js",
libraryTarget: "commonjs2",
path: path.resolve(process.cwd(), "dist"),
},
2024-12-09 01:43:18 +00:00
devtool: "source-map",
externals: {
2024-12-09 01:43:18 +00:00
vscode: "commonjs vscode",
},
resolve: {
2024-12-09 01:43:18 +00:00
extensions: [".ts", ".js", ".json"],
},
2019-09-22 16:56:19 +00:00
plugins: [new CleanWebpackPlugin()],
optimization: {
2020-12-20 11:16:48 +00:00
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: true,
terserOptions: {
2020-12-20 11:16:48 +00:00
output: {
comments: false,
},
mangle: false,
keep_classnames: true,
2019-09-22 16:56:19 +00:00
keep_fnames: true,
},
}),
],
},
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/,
},
],
},
};