Hello everyone, as part of the quick post series that I am doing (If you haven't seen my previous post, you can check Quickstart with Svelte 3).
S...
For further actions, you may consider blocking this person and/or reporting abuse
This is a nice tutorial, helped me a lot.
hydratable is now inside the compilerOptions section in
svelte >= 3.0.0
below code might help
plugins: [
svelte({
preprocess: sveltePreprocess({ sourceMap: !production }),
compilerOptions: {
hydratable: true,
// enable run-time checks when not in production
dev: !production
}
}),
by the way to remind, you can import sveltePreprocess from svelte-preprocess after installed
Nice tutorial! ... I was wondering how I could change the current page's title? The way I understand until now is that the title comes from the public located file index.html, but it would be nice to have a different title according to the current page.
Good catch, definitely this is a great feature I will create a new post to explain how can we set a Title dynamically or if you already found a workaround I will be happy to see the implementation.
As an update, it is not necessary to use a
server.js
file; only add the option--single
to the scriptstart
like this:This is from the documentation of
sirv
npmjs.com/package/sirv-cli
Nice write up. Let me add to the discussion that there is another routing solution for svelte projects routify.dev/
Wow, I didn't know this library but looks very good. I saw the guide and the documentation and seems pretty easy to implement and also has nice features as
goto
,params
, and more.Thank you for share this new solution. 😃
by the time.. is routify better?
If you are hosting in a LAMP server use this trick
craete a .htaccess file in root folder with below code
FallBackResource index.html
this will work if your using the build output using this command
npm run build
also remember to use this code in your App.svelte file : Click Here
Hello, the Link pattern is easy, but how could I redirect to another route as a result of an action?
My scenario:
How can I invoke the link/route from typescript?
I found it ;-)
navigate()
For people getting console errors about hydratable, notice that the correct syntax in main.js is not: "hydrate: true", like in the blog post, but "hydratable: true"
My svelte app can finally reload pages! Thanks a lot!!!
Amazing!!!, also if you want to connect your app with Rest services, this link can help you.
dev.to/lukocastillo/svelte-3-how-t...
Where i need to put the server.js file?