-
Notifications
You must be signed in to change notification settings - Fork 32
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
How to use with sveltekit - A mini guide. #130
Comments
Thank you for this. |
A more complete example:
However the text is reversed for some reason when I type which is weird. |
Is this still the case? I was going to use it for my svelte.kit project and add modules as needed, but not interested in using if its this far behind alternatives. |
Thank you for saving me so much time. |
RIP And if I try to import typewriter in the script section:
(I had to install @typewriter/document manually because it was throwing an error about it missing.) Is this suppose to be svelte compatible ? I don't see any documentation about it working 😂 |
Here is my good deed for the day. I have gotten it to work with sveltekit finally.
There are three things to do.
vite.config.ts add this.
optimizeDeps: {
include: ['typewriter-editor > @typewriter/document']
}
svelte.config.ts - add this snippet (I am not sure this step is necessary)
vitePlugin: {
prebundleSvelteLibraries: true,
},
3 - Only load in browser
<script> import { browser } from '$app/environment'; </script>.svelte file:
This works in Dev, I think I may need to add @rollup/plugin-commonjs to get it to build for prod. I will report back. Good luck all.
The text was updated successfully, but these errors were encountered: