MCSManager/panel/webpack.config.js
2024-05-09 14:48:04 +08:00

44 lines
827 B
JavaScript
Executable File

const path = require("path");
const nodeExternals = require("webpack-node-externals");
/**
* @type {import('webpack').Configuration}
*/
module.exports = {
mode: "production",
entry: "./src/app.ts",
module: {
rules: [
{
test: /\.ts/,
use: "ts-loader",
exclude: /node_modules/
}
]
},
target: "node",
devtool: "source-map",
optimization: {
chunkIds: "named",
minimize: false,
mangleExports: false,
moduleIds: "named"
},
externalsPresets: { node: true },
externals: [
nodeExternals({
allowlist: ["common"]
})
],
output: {
filename: "app.js",
path: path.resolve(__dirname, "production")
},
resolve: {
extensions: [".ts", ".js"],
alias: {
"@languages": path.resolve(__dirname, "../languages")
}
}
};