-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
35 lines (33 loc) · 1.17 KB
/
webpack.config.js
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
/* eslint-disable node/no-unpublished-require */
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const crypto = require("crypto");
const crypto_orig_createHash = crypto.createHash;
crypto.createHash = (algorithm) =>
crypto_orig_createHash(algorithm === "md4" ? "sha256" : algorithm);
const config = {
target: "node",
entry: { main: "./src/main.js" },
optimization: {
minimizer: [new OptimizeCSSAssetsPlugin(), new TerserPlugin()],
},
plugins: [new MiniCssExtractPlugin({ filename: "styles.minified.css" })],
module: {
rules: [
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, "css-loader"] },
],
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "main.js",
libraryTarget: "commonjs2",
devtoolModuleFilenameTemplate: "../[resource-path]",
},
devtool: "source-map",
externals: {
vscode: "commonjs vscode", // the vscode-module is created on-the-fly and must be excluded.
},
};
module.exports = config;