0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-24 16:29:46 +01:00
Cybernetically enhanced web apps https://svelte.dev/
Go to file
2016-12-27 14:58:46 -06:00
.github Typo in issue template 2016-12-27 14:58:46 -06:00
rollup consolidate rollup config 2016-12-20 11:02:13 -05:00
src handle component directives at positions other than end (fixes #221) 2016-12-24 14:31:32 -05:00
test handle component directives at positions other than end (fixes #221) 2016-12-24 14:31:32 -05:00
.editorconfig add editorconfig and flowconfig files 2016-12-05 10:02:55 +01:00
.eslintignore consolidate rollup config 2016-12-20 11:02:13 -05:00
.eslintrc.json another lint fix 2016-12-07 12:39:45 -05:00
.flowconfig add editorconfig and flowconfig files 2016-12-05 10:02:55 +01:00
.gitignore consolidate rollup config 2016-12-20 11:02:13 -05:00
.travis.yml
CHANGELOG.md -> v1.6.1 2016-12-24 14:39:53 -05:00
LICENSE update license with link to contributors page 2016-12-06 17:41:01 -05:00
mocha.coverage.opts restructure tests 2016-12-08 12:08:27 +01:00
mocha.opts restructure tests 2016-12-08 12:08:27 +01:00
package.json -> v1.6.1 2016-12-24 14:39:53 -05:00
README.md Add link to Meteor build plugin 2016-12-18 12:35:38 +01:00

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