You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The styles from a vue project build remain present on declared but not used variables on the resulting .js files even after it gets extracted to their own .css files.
On a project with a large css (for instance, importing a framework), this can bloat the javascript file by 400, 500k
Reproduction
git clone https://github.com/vitejs/vite.git vite
cd vite
yarn
yarn build
cd packages/playground/vue
yarn build
Below are the resulting files, notice all styles are duplicated on the built javascript file on variables not used anywhere like Hmr_vue_vue_type_style_index_0_lang, PreProcessors_vue_vue_type_style_index_0_lang and PreProcessors_vue_vue_type_style_index_1_scoped_true_lang
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Provide a description in this issue that describes the bug.
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/vue-next instead.
Describe the bug
The styles from a vue project build remain present on declared but not used variables on the resulting .js files even after it gets extracted to their own .css files.
On a project with a large css (for instance, importing a framework), this can bloat the javascript file by 400, 500k
Reproduction
Below are the resulting files, notice all styles are duplicated on the built javascript file on variables not used anywhere like
Hmr_vue_vue_type_style_index_0_lang
,PreProcessors_vue_vue_type_style_index_0_lang
andPreProcessors_vue_vue_type_style_index_1_scoped_true_lang
index.a4fdb80a.css
index.19cdf8f1.js
System Info
Output of
npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:Used package manager:
yarn
Logs
N/A
Before submitting the issue, please make sure you do the following
The text was updated successfully, but these errors were encountered: