Style in vue files is ignored when `sideEffects: false` is defined in package.json
See original GitHub issueBug report
Version
0.14.0
Steps to reproduce
Create a vue component in .vuepress/components
<template>
<p class="red">Should be red</p>
</template>
<style scoped>
.red {
color: red
}
</style>
Add "sideEffects": false
to package.json
file
The scoped
attribute doesn’t have an impact
What is expected?
When runnig the build, the css should be extracted in a CSS file
What is actually happening?
The CSS is dropped at some point, but it works correctly under dev
Other relevant information
- Your OS: latest osx
- Node.js version: 10
- Browser version: Chrome
- Is this a global or local install? local
- Which package manager did you use for the install? yarn
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Webpack not loading Vue's single file components CSS
The HTML and Vue is rendered correctly but without CSS. It seems to be an issue with webpack configuration. Any idea what's wrong?...
Read more >Tree Shaking - webpack
Tree shaking is a term commonly used in the JavaScript context for dead-code elimination. It relies on the static structure of ES2015 module...
Read more >Server-Side Rendering (SSR) - Vue.js
Rendering an App # · Create a new directory and cd into it · Run npm init -y · Add "type": "module" in...
Read more >TSConfig Reference - Docs on every TSConfig option
A file specified by exclude can still become part of your codebase due to an import ... code is ignored; false raises compiler...
Read more >How To Make Tree Shakeable Libraries - Theodo blog
json file. It is by default set to true when unspecified (there are side effects in every module of the package). You can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found a related issue: https://github.com/webpack/webpack/issues/6741.
After change
sideEffects: false
to:The style comes back.
Finally found the problem: it’s adding
sideEffects: false
to package.json file (it’s a webpack thing for libraries). I created a pull request adding that to the package.json file: https://github.com/ulivz/vuepress-718/pull/1