Skip to content

chuanqisun/svelte-electron-template

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Svelte Electron Template

The bare minimum boilerplate to use svelte in electron

screenshot

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.

// 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.

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

About

The bare minimum boilerplate to use svelte in electron

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published