-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Compiled template classes preserve whitespace #12113
Comments
Note this would require a new option since it's different from whitespace as it's inside of an attribute value and spaces could be important for attributes other than Edit: or as mentioned in vuejs/core#4251, it could automatically apply to |
不懂 |
Template static classes used to preserve whitespace after compilation, resulting in builds that had bigger file outputs with whitespace in component's staticClass attributes fix vuejs#12113
Is this a feature request or a bug? Updating from Vue & the template compiler |
…nore flag in regex fix vuejs#12113
… purged in static classes There's no need to escape newlines in static classes, as they're now replaced with a single whitespace character fix vuejs#12113
I think I've fixed this issue/implemented this feature here. |
* feat(compiler): template staticClass no longer preserves whitespace Template static classes used to preserve whitespace after compilation, resulting in builds that had bigger file outputs with whitespace in component's staticClass attributes fix #12113 * refactor(refactor(web-compiler): removed ignore in regex): Removed ignore flag in regex fix #12113 * test(ssr-string.spec.js): Removed newline character, as whitespace is purged in static classes There's no need to escape newlines in static classes, as they're now replaced with a single whitespace character fix #12113 * test(directives/class.spec.js): Added whitespace to test fix #12113 * Apply suggestions from code review Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
Version
2.6.13
Reproduction link
https://codesandbox.io/s/dazzling-cache-q8y8o?file=/src/App.vue
Steps to reproduce
Add whitespace between classes, for example with the latest changes in prettier sorting classes into individual newlines, an they'll end up with whitespace on production builds.
Example:
Template.vue
:Will be compiled to this
This happens regardless of whitespace preservation options in the compiler
What is expected?
Expected
class
names to be trimmed of whitespace during production builds.What is actually happening?
Whitespace isn't trimmed in
class
names after compilation of templates.The text was updated successfully, but these errors were encountered: