Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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');
```