0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
Cybernetically enhanced web apps https://svelte.dev/
Go to file
2017-03-01 18:34:46 -05:00
.github Update ISSUE_TEMPLATE.md 2017-01-03 19:15:05 -05:00
rollup two-way component binding in SSR (#275) 2017-02-08 12:13:02 -05:00
src merge master -> gh-177 2017-03-01 18:29:05 -05:00
test merge master -> gh-177 2017-03-01 18:29:05 -05:00
.editorconfig
.eslintignore consolidate rollup config 2016-12-20 11:02:13 -05:00
.eslintrc.json
.flowconfig
.gitignore handle implicitly closed elements 2017-03-01 16:11:03 -05:00
.travis.yml
appveyor.yml add appveyor config 2017-01-04 13:36:32 -05:00
CHANGELOG.md -> v1.9.0 2017-03-01 18:34:46 -05:00
LICENSE
mocha.coverage.opts
mocha.opts
package.json -> v1.9.0 2017-03-01 18:34:46 -05:00
README.md

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