Need help installing a vite plugin, in a nuxt 3 app

Hey guys. So I'm working with shaders in a nuxt 3 threejs project, and I'm trying to install vite-pligin-glsl (https://www.npmjs.com/package/vite-plugin-glsl), so I can import and use .glsl files It seems vite.config.js isn't used in nuxt 3 anymore. Please could someone help me out with how I can go about installing the plugin So far I've searched, my only lead is Nuxt kit (https://nuxt.com/docs/api/kit/builder). I don't know if I'm going the right direction
4 Replies
danielroe
danielroe9mo ago
Set almost anything you would with vite.config in your nuxt config, under the vite option.
ɬɧҽƈαʋყɖҽʋ
Thanks Chief!
danielroe
danielroe9mo ago
:salute:
ɬɧҽƈαʋყɖҽʋ
So what I was hoping to achieve with plugin didn't work, I'm tryin out another option that requires webpack. I changed up the config:
export default defineNuxtConfig({
devtools: { enabled: true },

builder: 'webpack',

webpack: {
loaders: {
vue: {
hotReload: true,
}
}
}

})
export default defineNuxtConfig({
devtools: { enabled: true },

builder: 'webpack',

webpack: {
loaders: {
vue: {
hotReload: true,
}
}
}

})
When I run the server, I get:
ERROR [unhandledRejection] Parse Error: Data after Connection: close
at Socket.socketOnData (node:_http_client:532:22)
at Socket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
ERROR [unhandledRejection] Parse Error: Data after Connection: close
at Socket.socketOnData (node:_http_client:532:22)
at Socket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
The app runs in the browser, but nothing else after that Hot reload seems disconnected.
I'm I missing something?
Want results from more Discord servers?
Add your server