Closed RoeelCohen closed 3 years ago
Hi @RoeelCohen! Thanks for opening this issue, I've reproduced it and you're totally right: as for now tslib
module is required. As mentioned in README of tslib
:
Because this can avoid duplicate declarations of things like extends, assign, etc., this means delivering users smaller files on average, as well as less runtime overhead. For optimized bundles with TypeScript, you should absolutely consider using tslib and --importHelpers.
So I'd like to keep it in vite-plugin-glsl
as well. I think the only thing I'm missing here is to add it in dependencies
of this project. I'm going to fix it ASAP. As for now, if you'd like to keep using vite-plugin-glsl
in your vite vanilla js setup, one possible workaround is to add it manually in you package.json
:
{
"name": "vite-project",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"devDependencies": {
"tslib": "^2.3.1",
"vite": "^2.6.4",
"vite-plugin-glsl": "^0.0.4"
}
}
@RoeelCohen As mentioned above, I've updated this package and tested it with VanillaJS vite config. I'm closing this issue, but feel free to open another one if the problem persists or there's something else I've missed. Thanks for your feedback!
I have a simple VanillaJs Vite application running. Tried to add the glsl plugin but I'm getting the following issue after I run
vite
using npm:package.json
scripts:Error:
Which seems a bit weird? since ts should be supported on vite without any configurations? Resorted to use the string loader which doesn't require additional modules