Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] When "sideEffects" is added in package.json, Vue component style do not work. #1628

Closed
huangjunjie3-tal opened this issue Jan 22, 2025 · 1 comment
Labels
question Asking question

Comments

@huangjunjie3-tal
Copy link

Description

In client.ts, I registered a Vue component through enhance. The code of this Vue component is as follows:

<template>
  <div>hello world</div>
</template>

<style scoped>
div {
  color: red;
}
</style>

When I have sideEffects in my package.json, such as sideEffects: false, and I run npm run dev, the "hello world" on the page is not red. But when I remove the sideEffects from package.json, the "hello world" on the page turns red.
You can try in the Reproduction.

Reproduction

https://github.com/huangjunjie3-tal/vuepress-style-issues

Used Package Manager

npm

System Info

Not needed
@Mister-Hope
Copy link
Member

Mister-Hope commented Jan 22, 2025

This is expected, see vitejs/vite#9308 (comment)

Note: for bundler behaviors, you should ALWAYS test on a pure vite/Webpack project based on your bundler to check the behavior before opening any issue here. If they are the same, report to bundler repo for any unexpected behavior in your sight, rather than posting here.

None of our team are willing to teach you bundler knowledge, or wasting our time finding a proper reference for you.

@Mister-Hope Mister-Hope closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2025
@Mister-Hope Mister-Hope added the question Asking question label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking question
Projects
None yet
Development

No branches or pull requests

2 participants