2025-04-23 13:10:13 +03:00
|
|
|
const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin');
|
2025-04-23 14:31:11 +03:00
|
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
2025-04-23 13:10:13 +03:00
|
|
|
const { join } = require('path');
|
|
|
|
|
2025-04-23 14:31:11 +03:00
|
|
|
const outputDir = join(__dirname, 'dist');
|
|
|
|
|
2025-04-23 13:10:13 +03:00
|
|
|
module.exports = {
|
|
|
|
output: {
|
2025-04-24 22:16:59 +03:00
|
|
|
path: outputDir,
|
2025-04-23 13:10:13 +03:00
|
|
|
},
|
2025-04-24 21:30:31 +03:00
|
|
|
target: [ "node" ],
|
2025-04-23 13:10:13 +03:00
|
|
|
plugins: [
|
|
|
|
new NxAppWebpackPlugin({
|
|
|
|
target: 'node',
|
|
|
|
compiler: 'tsc',
|
2025-04-23 13:22:13 +03:00
|
|
|
main: './src/electron-main.ts',
|
2025-04-23 13:10:13 +03:00
|
|
|
tsConfig: './tsconfig.app.json',
|
|
|
|
assets: ["./src/assets"],
|
|
|
|
optimization: false,
|
|
|
|
outputHashing: 'none',
|
|
|
|
generatePackageJson: true,
|
2025-04-23 13:29:27 +03:00
|
|
|
externalDependencies: [
|
2025-04-23 19:59:16 +03:00
|
|
|
"electron/main",
|
2025-04-24 22:16:59 +03:00
|
|
|
"@electron/remote/main",
|
2025-04-23 19:59:16 +03:00
|
|
|
"electron",
|
2025-04-24 21:30:31 +03:00
|
|
|
"@electron/remote",
|
|
|
|
"better-sqlite3"
|
2025-04-24 23:27:01 +03:00
|
|
|
]
|
2025-04-23 14:31:11 +03:00
|
|
|
}),
|
|
|
|
new CopyPlugin({
|
2025-04-24 21:30:31 +03:00
|
|
|
patterns: [
|
2025-04-24 15:04:39 +03:00
|
|
|
{
|
|
|
|
from: "../client/dist",
|
|
|
|
to: join(outputDir, "public")
|
2025-04-24 15:39:34 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
from: "../server/dist/node_modules",
|
|
|
|
to: join(outputDir, "node_modules")
|
|
|
|
},
|
|
|
|
{
|
|
|
|
from: "../server/dist/assets",
|
|
|
|
to: join(outputDir, "assets")
|
2025-04-24 22:16:59 +03:00
|
|
|
},
|
|
|
|
{
|
2025-04-25 18:23:52 +03:00
|
|
|
from: "../../node_modules/@electron/remote",
|
2025-04-24 22:16:59 +03:00
|
|
|
to: join(outputDir, "node_modules/@electron/remote")
|
2025-04-24 21:45:13 +03:00
|
|
|
}
|
2025-04-23 14:31:11 +03:00
|
|
|
]
|
2025-04-23 13:10:13 +03:00
|
|
|
})
|
2025-04-24 21:30:31 +03:00
|
|
|
]
|
2025-04-23 13:10:13 +03:00
|
|
|
};
|