0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-29 16:36:44 +01:00
Cybernetically enhanced web apps https://svelte.dev/
Go to file
2016-12-18 12:35:38 +01:00
.github Update ISSUE_TEMPLATE.md 2016-12-10 13:38:58 -05:00
src Merge pull request #206 from sveltejs/gh-144 2016-12-17 17:20:03 -05:00
test throw if options.name is illegal 2016-12-17 16:55:40 -05:00
.editorconfig add editorconfig and flowconfig files 2016-12-05 10:02:55 +01: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 rename folders to remove .gitignore confusion 2016-12-07 12:03:10 -05:00
.travis.yml use a valid nvm version ID instead of the deprecated one 2016-12-01 18:07:36 +09:00
CHANGELOG.md -> v1.3.1 2016-12-17 17:24:06 -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.3.1 2016-12-17 17:24:06 -05:00
README.md Add link to Meteor build plugin 2016-12-18 12:35:38 +01:00
rollup.config.main.js add a compiler option to output SSR code 2016-12-08 15:15:53 +01:00
rollup.config.ssr.js add a compiler option to output SSR code 2016-12-08 15:15:53 +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