-
-
Notifications
You must be signed in to change notification settings - Fork 3
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 do I use syntastica-js on the web? #6
Comments
The syntastica-js package in its current state is over 60 MB big, which is not suitable for the web. This is because all languages are included in one binary. I have not yet figured out a way to split the package into multiple separate packages (one per language plus one core package) and lazily fetch language binaries from the server on demand. But if that is not a concern for you, a look at the example vite project may help, which uses an old version (the latest on npm) with only a few languages, where the bundle size was "only" ~9 MB. I also encountered a similar issue as you did, but couldn't figure out how to fix it from the package itself (I'm not that experienced with bundlers), but I found a workaround for vite: syntastica/examples/js/vite/vite.config.ts Lines 7 to 13 in 5872bc9
With some googling there are probably also similar workarounds for other bundlers. I'm pretty sure I already found one for Rollup, but didn't save it anywhere. |
Right, I guess I got the wrong idea from the example code writing to Again, thanks very much! |
No you got it right, syntastica-js was meant to be used on the web, it's just that after having added so many more languages I realized the current approach wasn't working and I would have to figure something else out, so it just stayed in limbo since then. I also finally got around to better explaining the current Wasm support here and added two more tiny example projects. |
I see from the example code that syntastica-js is intended to be used on the web.
However, I can't work out how to access it from the browser.
I tried adding syntastica to my simple webpack-bundled project, and got an error that started:
Sorry, I'm quite new to modern web JavaScript (more used to Node on the back-end), so apologies if I'm just being clueless, and thanks for syntastica!
The text was updated successfully, but these errors were encountered: