0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-30 00:46:29 +01:00
Cybernetically enhanced web apps https://svelte.dev/
Go to file
2017-03-08 12:26:47 -05:00
.github Update ISSUE_TEMPLATE.md 2017-01-03 19:15:05 -05:00
rollup transpile/remove stuff that wont work in Node 4 2017-03-07 12:05:41 -05:00
src fix two-way binding for components inside each-blocks - closes #356 2017-03-08 12:04:27 -05:00
test fix two-way binding for components inside each-blocks - closes #356 2017-03-08 12:04:27 -05:00
.editorconfig add editorconfig and flowconfig files 2016-12-05 10:02:55 +01:00
.eslintignore lint 2017-03-07 14:10:42 -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 handle implicitly closed elements 2017-03-01 16:11:03 -05:00
.travis.yml add Node 4 to travis build matrix 2017-03-07 12:09:10 -05:00
appveyor.yml add appveyor config 2017-01-04 13:36:32 -05:00
CHANGELOG.md -> v1.11.1 2017-03-08 12:26:47 -05:00
LICENSE update license with link to contributors page 2016-12-06 17:41:01 -05:00
mocha.coverage.opts move tests around to facilitate registering babel based on environment 2017-03-07 14:10:28 -05:00
mocha.opts move tests around to facilitate registering babel based on environment 2017-03-07 14:10:28 -05:00
package.json -> v1.11.1 2017-03-08 12:26:47 -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