tmorgan497
tmorgan497
NNuxt
Created by tmorgan497 on 6/13/2024 in #❓・help
High CPU Usage in Docker when running Nuxt in dev
Tested on NixOS. I don't get the same issue with high CPU usage. Maybe it's a Windows issue only. I'll try to rule out an issue with my own machine by running it on another Windows machine when I get a chance. https://github.com/nuxt/nuxt/issues/27617#issuecomment-2173371370
6 replies
NNuxt
Created by tmorgan497 on 6/13/2024 in #❓・help
High CPU Usage in Docker when running Nuxt in dev
I created a new issue on the nuxt github. https://github.com/nuxt/nuxt/issues/27617
6 replies
NNuxt
Created by tmorgan497 on 6/13/2024 in #❓・help
High CPU Usage in Docker when running Nuxt in dev
I may have narrowed it down to chokidar. When i comment out the environment variable CHOKIDAR_USEPOLLING=true, the CPU usage goes down to a normal level (under 1%). IIRC, chokidar is used for HMR, so I usually leave it active during development so I don't have to restart the container everytime I make a change. Any thoughts on how to reduce its CPU usage? I added a watcher ignore param to my nuxt.config.ts, but it doesn't seem to do anything to help reduce the CPU usage.
watchers: {
webpack: {
ignored: /node_modules/
}
},
watchers: {
webpack: {
ignored: /node_modules/
}
},
6 replies
NNuxt
Created by tmorgan497 on 6/13/2024 in #❓・help
High CPU Usage in Docker when running Nuxt in dev
Here's a minimal app with docker that reproduces the issue: https://github.com/tmorgan497/minimal-nuxt-docker
6 replies
NNuxt
Created by tmorgan497 on 6/13/2024 in #❓・help
High CPU Usage in Docker when running Nuxt in dev
and my nuxt.config.ts:
import * as path from 'path';
const auraPath = path.join(__dirname, 'pv-presets', 'aura').replace(/\\/g, '/');

export default defineNuxtConfig({
devtools: { enabled: true },
ssr: false,
watchers: {
webpack: {
ignored: /node_modules/
}
},

css: [
'~/assets/css/main.css',
],

typescript: {
includeWorkspace: true
},

postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},

modules: [
'nuxt-icon',
'@nuxtjs/tailwindcss',
'@vueuse/nuxt',
'nuxt-primevue',
'@pinia/nuxt',
'@pinia-plugin-persistedstate/nuxt',
],

primevue: {
options: { unstyled: true, ripple: true },
importPT: { as: 'Aura', from: auraPath },
components: {
// prefix: 'P',
exclude: ['Editor', 'Chart']
}
},
})
import * as path from 'path';
const auraPath = path.join(__dirname, 'pv-presets', 'aura').replace(/\\/g, '/');

export default defineNuxtConfig({
devtools: { enabled: true },
ssr: false,
watchers: {
webpack: {
ignored: /node_modules/
}
},

css: [
'~/assets/css/main.css',
],

typescript: {
includeWorkspace: true
},

postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},

modules: [
'nuxt-icon',
'@nuxtjs/tailwindcss',
'@vueuse/nuxt',
'nuxt-primevue',
'@pinia/nuxt',
'@pinia-plugin-persistedstate/nuxt',
],

primevue: {
options: { unstyled: true, ripple: true },
importPT: { as: 'Aura', from: auraPath },
components: {
// prefix: 'P',
exclude: ['Editor', 'Chart']
}
},
})
6 replies