Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chuanqisun/svelte-electron-template
The bare minimum boilerplate to use svelte in electron
https://github.com/chuanqisun/svelte-electron-template
boilerplate electron svelte svelte3 template
Last synced: 3 months ago
JSON representation
The bare minimum boilerplate to use svelte in electron
- Host: GitHub
- URL: https://github.com/chuanqisun/svelte-electron-template
- Owner: chuanqisun
- License: mit
- Created: 2019-06-22T17:42:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T07:21:28.000Z (about 2 years ago)
- Last Synced: 2024-09-29T12:03:24.424Z (3 months ago)
- Topics: boilerplate, electron, svelte, svelte3, template
- Language: JavaScript
- Size: 245 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Svelte Electron Template
The bare minimum boilerplate to use svelte in electron
![screenshot](screenshot.png)
## Quick start
`npm start` to build, bundle, and watch the svelte app, then load it as renderer thread in an electon app.
## Import modules for **browser**
Use ES6 `import`. The modules will be bundled.
```javascript
// you can import from relative path
import MyComponent from './MyComponent.svelte';
import { myUtilFunc } from './MyUtilFunc';// or from node modules
import { writable } from 'svelte/store';
```## Import modules for **node**
Use CommonJS `require()`. The modules will NOT be bundled. The import will be resolved at runtime.
```javascript
const app = require('electron').remote.app;
const path = require('path');
const fs = require('fs');// DON'T do this. It will NOT be bundled!
const { writable } = require('svelte/store');
```