All scoped CSS are loaded when extractCSS is enabled
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 285
- Forks
- 33
- Avg merge
- 22h 38m
- Merged PRs (30d)
- 3
Description
Environment
- Operating System:
Darwin - Node Version:
v14.17.6 - Nuxt Version:
2.15.8 - Package Manager:
npm@6.14.15 - Bundler:
Webpack - User Config:
ssr,dev,modern,env,render,head,loading,css,plugins,components,modules,buildModules,purgeCSS,axios,publicRuntimeConfig,privateRuntimeConfig,build,router,pwa,vuetify - Runtime Modules:
@nuxtjs/axios@5.13.6 - Build Modules:
@nuxtjs/pwa@3.3.5,@nuxtjs/vuetify@1.12.3,@nuxtjs/composition-api/module@^0.31.0,nuxt-custom-headers@2.1.0,nuxt-purgecss@1.0.0,@/modules/admanager,@nuxtjs/firebase@8.2.2
Reproduction
https://codesandbox.io/s/clever-einstein-rkbwb?file=/nuxt.config.js
Describe the bug
When load a page, all css files are loaded from pages and components, same the scoped attribute is present.
Ex:
pages
- index.vue (scoped style)
- about.vue (scoped style)
components
- componenta.vue (scroped style)
- componentb.vue (scoped style)
When request page index.vue are loaded all CSS: index.css, about.css, componenta.css, componentb.css
Additional context
No response
Logs
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox reproduction and inspect its nuxt.config.js, focusing on the extractCSS setting and the scoped styles described in the issue. Reproduce a request for index.vue and verify that only the CSS required for that page is loaded rather than the styles from about.vue and the other components.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxt, webpack
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100