-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed
Labels
Description
Describe the bug
When I set style.scoped: true
in Vue plugin options, I would have expected, that all SFCs would now use scoped styles. But it does not seem to have any effect.
The same goes for setting style.scoped: false
. I would have expected, it overrides SFCs, that explicitly set style scoped
, not to use scoped styles.
I think the bug (if it is one and not intended) is, that block.scoped
always overrides style.scoped
here: https://github.com/vitejs/vite/blob/main/packages/plugin-vue/src/style.ts#L25
Reproduction
https://stackblitz.com/edit/vitejs-vite-oiw3bg?file=vite.config.js
System Info
System:
OS: macOS 12.2.1
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 33.63 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.14.2 - ~/.asdf/installs/nodejs/16.14.2/bin/node
npm: 8.5.0 - ~/.asdf/plugins/nodejs/shims/npm
Browsers:
Chrome: 100.0.4896.127
Firefox: 98.0.2
Safari: 15.3
npmPackages:
@vitejs/plugin-vue: * => 2.3.1
vite: * => 2.9.1
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.