GitXplorerGitXplorer
a

erb-sqlite-example

public
47 stars
24 forks
4 issues

Commits

List of commits on branch main.
Unverified
635e205a59b6e02dfc5ef894f1b4121f5646df5d

ci updates

aamilajack committed 3 years ago
Unverified
45855357a3262dcf3656c9dc2736250c45c5b3d3

fix: remove outdated type defs

aamilajack committed 3 years ago
Unverified
a8646ba2b572380a72f649d75857186d5096ceb5

fix: readme fixes

aamilajack committed 3 years ago
Unverified
de995a6439661dc812e0a1262df104cae02c700a

fix: readme updates

aamilajack committed 3 years ago
Unverified
e899f37fd4d0602b0e3746e912de96d2cdd062dc

feat: add sqlite3 to main process

aamilajack committed 3 years ago
Unverified
dc822dc212a37862cbf5e293cc5122ed954079f7

chore: bump deps

aamilajack committed 3 years ago

README

The README file for this repository.

erb-sqlite-example

Test

An example of erb with native dependencies (sqlite3 in this case)

Setup

git clone https://github.com/amilajack/erb-sqlite-example.git
cd erb-sqlite-example
npm i
npm start

How it works

sqlite3 is a native dependency that needs to be compiled before it is used (therefore it is consiered 'native dependency'). sqlite3 and any other depencencies in ./build/app/package.json are imported as an externals, which means that webpack doesn't process them. The dependency will be imported with normal require() calls.

Some native dependencies have issues with how webpack bundles code. One solution to these kinds of issues is to add those native dependencies to your ./build/app/package.json. These dependencies are automatically rebuilt against electron's node version after installing (see the postinstall script in ./build/app/package.json). electron-builder will also rebuild dependencies just before packaging your app.

You must install the dependencies as dependencies and not devDepencencies. Make sure to install like so for npm: npm install my-cool-depencency and like so for npm: npm i my-cool-dependency.

Notes

These changes that were made to ERB:

cd build/app
npm i sqlite3