Skip to content

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

@huangjunjie3-tal

Description

@huangjunjie3-tal

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions