windicss / windicss-webpack-plugin

🍃 Windi CSS for webpack ⚡
https://windicss.org/integrations/webpack.html
79 stars 19 forks source link

fix: remove transformedCSS <style> wrap #129

Closed nkxrb closed 12 months ago

nkxrb commented 1 year ago

<style${meta}>\n${transformedCSS}\n</style>

This writing breaks the source structure, resulting in generated hash inconsistencies, resulting in incorrect scopeId matching in vue。

so, I remove '\n' in <style${meta}>\n${transformedCSS}\n</style>

nkxrb commented 1 year ago

for example:

<style lang="scss" scoped>.list{color: red}</style>

vue will build three time
scopeId: b7d8492c rawQuery: '' scopeId: b7d8492c rawQuery: 'vue&type=script&lang=ts&setup=true' scopeId: b7d8492c rawQuery: 'vue&type=style&index=0&id=b7d8492c&lang=scss&scoped=true'

but installed windicss

windicss will build

<style lang="scss" scoped>\n.list{color: red}\n</style>

scopeId: 3bda2322 rawQuery: '' scopeId: b7d8492c rawQuery: 'vue&type=script&lang=ts&setup=true' scopeId: b7d8492c rawQuery: 'vue&type=style&index=0&id=b7d8492c&lang=scss&scoped=true'

harlan-zw commented 12 months ago

Sorry completely missed this PR! Thank you for taking the time to fix it.