bundling precompiled binary into electron app

Here’s another method, tested with Mac and Windows so far. Requires ‘app-root-dir’ package, doesn’t require adding anything manually to node_modules dir. Put your files under resources/$os/, where $os is either “mac”, “linux”, or “win”. The build process will copy files from those directories as per build target OS. Put extraFiles option in your build configs … Read more

How to use sqlite3 module with electron?

By far the easiest way to use SQLite with electron is with electron-builder. First, add a postinstall step in your package.json: “scripts”: { “postinstall”: “install-app-deps” … } and then install the necessary dependencies and build: npm install –save-dev electron-builder npm install –save sqlite3 npm run postinstall electron-builder will build the native module for your platform, … Read more

NPM run * doesn’t do anything

npm has a ignore-scripts configuration key. It’s expected value is a Boolean and it’s set to false by default. Perhaps it has inadvertently been set to true. To get/set the ignore-scripts configuration you can utilize the npm-config command: Check its current setting by running: npm config get ignore-scripts If the aforementioned command returns true then … Read more

Electron: jQuery is not defined

A better and more generic solution IMO: <!– Insert this line above script imports –> <script>if (typeof module === ‘object’) {window.module = module; module = undefined;}</script> <!– normal script imports etc –> <script src=”https://stackoverflow.com/questions/32621988/scripts/jquery.min.js”></script> <script src=”scripts/vendor.js”></script> <!– Insert this line after script imports –> <script>if (window.module) module = window.module;</script> Benefits Works for both browser and … Read more