-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
38 lines (37 loc) · 1.06 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
36
37
38
const path = require("path");
const { title } = require("process");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const nodeExternals = require('webpack-node-externals');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
entry: "./index.js", // Entry point for your app
target: "node", // Target Node.js runtime
output: {
filename: "bundle.js", // Consolidated output file
path: path.resolve(__dirname, "dist"),
},
mode: "production", // Enable optimizations
optimization: {
minimize: true, // Minify the output
},
externalsPresets: { node : true },
// externals: [
// nodeExternals({
// allowlist: ["cheerio"],
// })
// ],
resolve: {
extensions: ['.js', '.json'], // Ensure it resolves .js and .json files
modules: [path.resolve(__dirname, 'node_modules'), 'node_modules'],
},
plugins: [
new HtmlWebpackPlugin({
title: "htmltb-csv",
meta: {
author: "Tom. M.",
version: "0.1.1"
}
}),
new BundleAnalyzerPlugin(),
]
};