I am writing electron app which has to use standalone database (sqlite3 but it could be anything else). Database structure (metadata, SQL script or whatever else) is in a text file that I want included in the build directory as-is. The script is in directory sql (subdirectory in the project tree, same level as src, node_modules etc.).
I looked into electron-builder.yml and some documentation and thought I would solve my problem by adding a line specifying the directory containing my scripts.
Original content:
files:
- '!**/.vscode/*'
- '!src/*'
- '!electron.vite.config.{js,ts,mjs,cjs}'
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
after modification:
files:
- '!**/.vscode/*'
- '!src/*'
- '!electron.vite.config.{js,ts,mjs,cjs}'
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
- 'sql'
I also tried moving sql/ directory into src/ and change electron-builder.yml but after npm run dev
the directory is not copied to out/, nor to /build, which is what I would like to achieve.
Used dev packages:
electron, electron-builder, electron-vite, vite and a few more, but I believe these are essential for the problem.