33 lines
786 B
JavaScript
33 lines
786 B
JavaScript
|
const path = require("path");
|
||
|
|
||
|
module.exports = env => {
|
||
|
const production = env.NODE_ENV || "production";
|
||
|
|
||
|
return {
|
||
|
entry: "./src/main.ts",
|
||
|
devtool: production ? "source-map": "inline-source-map",
|
||
|
target: "node",
|
||
|
mode: env.NODE_ENV,
|
||
|
|
||
|
module: {
|
||
|
rules: [
|
||
|
{
|
||
|
test: /\.ts$/,
|
||
|
use: "ts-loader",
|
||
|
exclude: /node_modules/
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
resolve: {
|
||
|
extensions: [".ts", ".js"],
|
||
|
alias: {
|
||
|
shared: path.join(__dirname, "../shared/")
|
||
|
}
|
||
|
},
|
||
|
output: {
|
||
|
filename: "bundle.js",
|
||
|
path: path.resolve(__dirname, "dist")
|
||
|
}
|
||
|
};
|
||
|
};
|