Skip to content
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

preserving whitespaces #3531

Closed
antoniandre opened this issue May 25, 2021 · 3 comments
Closed

preserving whitespaces #3531

antoniandre opened this issue May 25, 2021 · 3 comments

Comments

@antoniandre
Copy link

Clear and concise description of the problem

I would like to have the option to preserve whitespaces through vite.config.js in order to be able to keep whitespaces in contents coming from a slot and displayed in a pre for instance. See vuejs/core#1600 (comment)

Suggested solution

It would be great to have the SFC compiler compilerOptions exposed in the Vite config, for instance:

export default defineConfig({
  plugins: [vue()],
  compilerOptions: {
    whitespace: 'preserve'
  }
}

I am also using Pug, and this comment makes me think it should already be possible from Vue 3 SFC compiler: #17 (comment) 🤔
If I missed something, my apologies.

Other than that, amazing work on Vite, lightning speed all the way! ⚡
esbuild & rollup: brilliant.

@haoqunjiang
Copy link
Member

@antoniandre
Copy link
Author

Thanks for that @sodatea, great to see it's exposed. 👍

That being said, I would really appreciate if you could give me a hand on my persistent whitespace issue - I know you've worked on vue-loader and other related core features and it's probably a piece of cake for you!

Filed on Vue 3 whitespace handling issue: vuejs/core#1600 (comment)
Codesandbox: https://codesandbox.io/s/interesting-cookies-dy7wn?file=/src/App.vue
thanks!

@github-actions
Copy link

This issue has been locked since it has been closed for more than 14 days.

If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Vite version. If you have any other comments you should join the chat at Vite Land or create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants