Skip to content

jormaj/svelte

This branch is 6 commits ahead of, 9674 commits behind sveltejs/svelte:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Feb 8, 2017
d83182c · Feb 8, 2017
Jan 4, 2017
Feb 8, 2017
Feb 8, 2017
Feb 8, 2017
Dec 5, 2016
Dec 20, 2016
Dec 7, 2016
Dec 5, 2016
Dec 20, 2016
Dec 1, 2016
Feb 1, 2017
Dec 6, 2016
Dec 18, 2016
Jan 4, 2017
Dec 8, 2016
Dec 8, 2016
Feb 1, 2017

Repository files navigation

Svelte

The magical disappearing UI framework.


This is the Svelte compiler, which is primarily intended for authors of tooling that integrates Svelte with different build systems. If you just want to write Svelte components and use them in your app, you probably want one of those tools:

API

import * as svelte from 'svelte';

const { code, map } = svelte.compile( source, {
	// the target module format – defaults to 'es' (ES2015 modules), can
	// also be 'amd', 'cjs', 'umd' or 'iife'
	format: 'umd',

	// the filename of the source file, used in e.g. generating sourcemaps
	filename: 'MyComponent.html',

	// the name of the constructor. Required for 'iife' and 'umd' output,
	// but otherwise mostly useful for debugging. Defaults to 'SvelteComponent'
	name: 'MyComponent',

	// for 'amd' and 'umd' output, you can optionally specify an AMD module ID
	amd: {
		id: 'my-component'
	},

	// custom error/warning handlers. By default, errors will throw, and
	// warnings will be printed to the console. Where applicable, the
	// error/warning object will have `pos`, `loc` and `frame` properties
	onerror: err => {
		console.error( err.message );
	},

	onwarn: warning => {
		console.warn( warning.message );
	}
});

Example/starter repos

License

MIT

About

Cybernetically enhanced web apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 35.6%
  • TypeScript 34.2%
  • HTML 29.2%
  • Other 1.0%