MCSManager/daemon/webpack.config.js

44 lines
827 B
JavaScript
Raw Normal View History

2023-08-20 23:06:38 +08:00
const path = require("path");
const nodeExternals = require("webpack-node-externals");
2024-05-09 14:48:04 +08:00
/**
* @type {import('webpack').Configuration}
*/
2023-08-20 23:06:38 +08:00
module.exports = {
mode: "production",
2024-05-09 14:48:04 +08:00
entry: "./src/app.ts",
module: {
rules: [
{
test: /\.ts/,
use: "ts-loader",
exclude: /node_modules/
}
]
},
2023-08-20 23:06:38 +08:00
target: "node",
2024-05-09 14:48:04 +08:00
devtool: "source-map",
optimization: {
chunkIds: "named",
minimize: false,
mangleExports: false,
moduleIds: "named"
},
2023-08-20 23:06:38 +08:00
externalsPresets: { node: true },
2023-12-28 22:19:50 +08:00
externals: [
nodeExternals({
allowlist: ["common"]
})
],
2023-08-20 23:06:38 +08:00
output: {
filename: "app.js",
path: path.resolve(__dirname, "production")
2023-09-05 18:47:10 +08:00
},
resolve: {
2024-05-09 14:48:04 +08:00
extensions: [".ts", ".js"],
2023-09-05 18:47:10 +08:00
alias: {
"@languages": path.resolve(__dirname, "../languages")
}
2023-08-20 23:06:38 +08:00
}
};