mirror of
https://github.com/UiO-Gaming/infoscreen3.git
synced 2026-11-05 13:56:52 +01:00
- Updated package.json to replace pkg with nexe for building executables. - Added rebuild-native-node20.js for rebuilding native modules for Node.js 20.18.1. - Introduced test-exe.js to facilitate testing of the generated executable. - Modified webpack.config.cjs to output bundle.cjs and set libraryTarget to commonjs2. - Enhanced profiler plugin for memory usage tracking with simplified output. - Removed unused dependencies and updated existing ones in package.json.
57 lines
1.5 KiB
JavaScript
57 lines
1.5 KiB
JavaScript
var path = require("path");
|
|
var fs = require("fs");
|
|
|
|
var nodeModules = { };
|
|
fs.readdirSync("./node_modules")
|
|
.filter(function (x) {
|
|
return [".bin"].indexOf(x) === -1;
|
|
})
|
|
.forEach(function (mod) {
|
|
nodeModules[mod] = "commonjs " + mod;
|
|
});
|
|
|
|
if (fs.existsSync("./data/sessions.db")) {
|
|
fs.rmSync("./data/sessions.db");
|
|
}
|
|
|
|
module.exports = [
|
|
{
|
|
name: "infoscreen3",
|
|
context: __dirname,
|
|
mode: 'production',
|
|
entry: "./infoscreen3.js",
|
|
target: "node",
|
|
output: {
|
|
path: __dirname + '/webpack',
|
|
filename: "bundle.cjs",
|
|
libraryTarget: 'commonjs2'
|
|
},
|
|
externals: nodeModules,
|
|
module: {
|
|
noParse: [/socket.io-client/],
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
exclude: /node_modules/,
|
|
}
|
|
}
|
|
},
|
|
{ test: /\.node$/, use: { loader: "node-loader" } }
|
|
]
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'socket.io-client': path.join(__dirname, 'node_modules', 'socket.io-client', 'socket.io.js')
|
|
},
|
|
extensions: ["", ".js", ".node"]
|
|
},
|
|
node: {
|
|
__dirname: true,
|
|
__filename: true
|
|
},
|
|
profile: true
|
|
}
|
|
]; |