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

Autoprefixer is not added to postcss.config.js on install #14

Closed
stefanobartoletti opened this issue May 5, 2020 · 3 comments
Closed

Comments

@stefanobartoletti
Copy link

stefanobartoletti commented May 5, 2020

After running vue add tailwind, the generated postcss.config.js does not cointain an entry for Autporefixer, like stated on the Readme.

Its contents are as follows:

module.exports = {
  plugins: {
    tailwindcss: {},
    'vue-cli-plugin-tailwind/purgecss': {}
  }
}
@forsartis
Copy link
Owner

Yeah that’s right. Autoprefixer is added internally in vue-cli since v4.1.0 vuejs/vue-cli#4798. I will update the readme.

@stefanobartoletti
Copy link
Author

stefanobartoletti commented May 6, 2020

I've done a little testing, and you are right: Autoprefixer seems to be automatically added in to the build process by Vue CLI.

Anyway, this seem to work as a default only if no postcss.config.js is present in the project root folder; if such file is present, I can only get the correct vendor prefixes after the build process if Autoprefixer is explicitly called into it.

Basically, my postcss.config.js file should be set like you previously described in the documentation, with an autoprefixer: {} line after the tailwind ones.

I suppose that this is working as intended (so, I don't think that it's a bug), probably the rationale is to have generic default settings while still leaving to the user the ability to manually change them; maybe it could be useful to ask directly to Vue CLI devs to have a confirmation about this .

Anyway, the fact is that if I include a postcss.config.js into my project, I need to explicitly include an Autprefixer to make it work as intended.

@forsartis
Copy link
Owner

Okay makes sense, providing your own postcss.config.js will overwrite Vue CLI’s internal one.
In that case, it would be best to add autoprefixer back in, because people expect that it is enabled by default.
Thanks for testing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants