Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for .svelte #897

Closed
fregante opened this issue Apr 19, 2020 · 1 comment · Fixed by #898
Closed

Add support for .svelte #897

fregante opened this issue Apr 19, 2020 · 1 comment · Fixed by #898
Labels

Comments

@fregante
Copy link
Collaborator

fregante commented Apr 19, 2020

Describe the feature

.svelte files containing imports are currently not supported. They look like HTML/Vue files.

Demo

This is what a .svelte file looks like:

<script>
	import CustomButton from './CustomButton.svelte';

	function handleClick() {
		alert('clicked');
	}
</script>

<CustomButton on:click={handleClick}/>

Real-life example: https://github.com/hankxdev/one-click-extensions-manager/blob/918841cbdbca86a88498595e660c122c7cef576b/source/App.svelte

Imports of .svelte files from .js files are already supported: https://github.com/hankxdev/one-click-extensions-manager/blob/918841cbdbca86a88498595e660c122c7cef576b/source/main.js

Additional information

Full docs about the language are here, but it looks like HTML for the most part (imports are found in regular <script> tags). My guess is that the .svelte extension can just be added to https://github.com/OctoLinker/OctoLinker/blob/a139f7f8fbc68b4f439edf12941b93271585b98f/packages/plugin-html/index.js

@fregante
Copy link
Collaborator Author

:woot:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant