2023-08-22 06:37:04 +02:00
|
|
|
const webpack = require("webpack");
|
|
|
|
const merge = require("webpack-merge");
|
|
|
|
const common = require("./webpack.electron.js");
|
2022-11-02 05:18:40 +01:00
|
|
|
const moment = require("dayjs");
|
2023-10-17 06:30:13 +02:00
|
|
|
const VERSION = require("../version.js");
|
2022-11-02 05:18:40 +01:00
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
function makeBuildStr() {
|
|
|
|
let buildStr = moment().format("YYYYMMDD-HHmmss");
|
2023-08-03 23:29:06 +02:00
|
|
|
console.log("Prompt Electron " + VERSION + " build " + buildStr);
|
2022-11-02 05:18:40 +01:00
|
|
|
return buildStr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const BUILD = makeBuildStr();
|
|
|
|
|
|
|
|
let merged = merge.merge(common, {
|
|
|
|
mode: "production",
|
|
|
|
output: {
|
2023-10-24 08:22:18 +02:00
|
|
|
path: path.resolve(__dirname, "../dist"),
|
2023-08-22 06:37:04 +02:00
|
|
|
filename: "[name].js",
|
2022-11-02 05:18:40 +01:00
|
|
|
},
|
|
|
|
devtool: "source-map",
|
|
|
|
optimization: {
|
|
|
|
minimize: true,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2023-08-22 06:37:04 +02:00
|
|
|
merged.plugins.push(
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
__PROMPT_DEV__: "false",
|
|
|
|
__PROMPT_VERSION__: JSON.stringify(VERSION),
|
|
|
|
__PROMPT_BUILD__: JSON.stringify(BUILD),
|
|
|
|
})
|
|
|
|
);
|
2022-11-02 05:18:40 +01:00
|
|
|
|
|
|
|
module.exports = merged;
|