-
Notifications
You must be signed in to change notification settings - Fork 74
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
Use Svelte v3 #5
Conversation
I think you might want to use E.g: import svelte from 'rollup-plugin-svelte';
import resolve from 'rollup-plugin-node-resolve';
import pkg from './package.json';
const input = pkg.svelte;
const name = pkg.name
.replace(/^(@\S+\/)?(svelte-)?(\S+)/, '$3')
.replace(/^\w/, m => m.toUpperCase())
.replace(/-\w/g, m => m[1].toUpperCase());
export default [
{
input,
output: { file: pkg.main, format: 'umd', name },
plugins: [
svelte(),
resolve()
]
},
{
input,
output: { file: pkg.module, format: 'es' },
external: ['svelte/internal'],
plugins: [svelte()]
}
]; |
This works for the most part but it seems to be ignoring content in |
I have tried it with <script>
export let name;
</script>
<h1>Hello {name}!</h1>
<style>
h1 {
color: rebeccapurple;
}
</style> and the CSS is included in the built files ( |
Is this PR under review? |
I think we have to ping @Rich-Harris, but I also remember him saying in Discord once that he has bigger plans for this repo than just a simple v3 update. He mentioned adding test infrastructure, IIRC. But maybe this PR should still be merged until he finds time for that? |
@yogev I haven’t tried this yet but it looks awesome - thank you for this
…On 1 Jun 2019, 08:44 +0100, Yogev Boaron Ben-Har ***@***.***>, wrote:
@sisou
In the meantime, I've made a template based on the app and component templates.
It's Svelte 3 based, but other than that it works exactly the same and you can preview your component running npm run dev, just as you would do in the full-blown app.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sorry this sat for so long! I think there are still vague bigger plans for this repo, but this is definitely much better than the v2-only thing this template was before. |
In case it's useful - I adapted the original repo to include livereload, making component development significantly easier. |
I updated the packages and changed the file extension to
.svelte
.I added the
resolve()
plugin so that the build includes the requiredsvelte/internal
helpers so the built component is able to run stand-alone. I think this is the expected behavior of this template?