How to use rollup-plugin-polyfill-node with @quasar/app-vite v2.5.2?
#18258
-
|
@quasar/app-vite v2.5 upgraded to Vite 8. Previously, I was using quasar.config: vitePlugins: [
[
nodePolyfills,
{
include: ['path'],
},
{ client: true, server: false },
],
],However, after upgrading to v2.5, this has stopped working and it is throwing TypeScript errors. Based on this discussion, we are now supposed to use npm install --save-dev rollup-plugin-polyfill-nodeimport nodePolyfills from '@rolldown/plugin-node-polyfills';
// ....
vitePlugins: [
[
nodePolyfills,
{ },
{ client: true, server: false },
],
],However this still throws TypeScript errors that I am not certain how to fix them. Anyone has any ideas how to use node polyfills with the new @quasar/app-vite v2.5? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi. Did you make a mistake while writing the discussion, or actually followed these steps? You said you installed Also, as you can see in its name, it's a Rolldown plugin, not a Vite plugin. So, the way you are using it won't work. You can try: extendViteConf: () => ({
build: {
rolldownOptions: {
plugins: [nodePolyfills()]
}
}
})But, there is a chance that it won't work. In that case, you might want to wait a bit until the vite plugin properly supports Vite 8 Also, just so you know, "this throws TS errors" is not helpful because the errors themselves could mean a lot of things. So, if none works, you can try sharing the actual errors you are getting and we might be able to provide further help. |
Beta Was this translation helpful? Give feedback.
Hi.
Did you make a mistake while writing the discussion, or actually followed these steps? You said you installed
rollup-plugin-polyfill-nodebut tried to use@rolldown/plugin-node-polyfills. You should runnpm install --save-dev @rolldown/plugin-node-polyfillsinstead.Also, as you can see in its name, it's a Rolldown plugin, not a Vite plugin. So, the way you are using it won't work. You can try:
But, there is a chance that it won't work. In that case, you might want to wait a bit until the vite plugin properly supports Vite 8
davidmyersdev/vite-plugin-node-polyfills#150
davidmyersde…