Skip to content

Commit

Permalink
chore: Update examples with hostProject Config, buildScripts (#18)
Browse files Browse the repository at this point in the history
* chore: Update examples with hostProject Config, buildScripts

* feat: added lock files
  • Loading branch information
viralgupta authored Aug 26, 2024
1 parent b71b908 commit e08e96d
Show file tree
Hide file tree
Showing 12 changed files with 1,814 additions and 778 deletions.
35 changes: 35 additions & 0 deletions examples/better-sqlite/backend/scripts/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// this file is not intended to be run directly, but rather to be run npm scripts

const path = require('path');
const webpack = require('webpack');

function main() {
console.log("Bundling server.mjs...");

webpack({
entry: "./server.mjs",
output: {
filename: 'server.js',
path: path.resolve(__dirname, '../dist'),
libraryTarget: 'commonjs2',
clean: true
},
resolve: {
extensions: ['.js', '.mjs']
},
target: 'node',
mode: 'production',
externals: {
"better-sqlite3": "better-sqlite3"
}
}).run((err, _stats) => {
if (err) {
console.error("Error bundling server.mjs:", err);
return;
}
console.log("Bundled server.mjs file successfully.");
})

}

main();
19 changes: 16 additions & 3 deletions examples/better-sqlite/neutralino.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"enabled": true,
"writeToLogFile": true
},
"enableExtensions": true,
"extensions": [
{
"id": "js.node-neutralino.projectRunner"
}
],
"nativeAllowList": [
"app.*",
"os.*",
Expand All @@ -33,7 +39,7 @@
},
"modes": {
"window": {
"title": "serial-port",
"title": "better-sqlite",
"width": 800,
"height": 500,
"minWidth": 400,
Expand Down Expand Up @@ -74,11 +80,18 @@
}
},
"cli": {
"binaryName": "serial-port",
"binaryName": "better-sqlite",
"resourcesPath": "/resources/",
"extensionsPath": "/extensions/",
"clientLibrary": "/resources/js/neutralino.js",
"binaryVersion": "5.2.0",
"clientVersion": "5.2.0"
"clientVersion": "5.2.0",
"hostProject": {
"projectPath": "/",
"buildPath": "./backend/dist/",
"initCommand": "npm run runner:install",
"devCommand": "npm run runner:dev",
"buildCommand": "npm run runner:build"
}
}
}
Loading

0 comments on commit e08e96d

Please sign in to comment.