-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Use different postcss.config.js file in vite.config.js then default postcss.config #3667
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
Comments
Hello @JoeriTheGreat. Please provide a online reproduction by codesandbox or a minimal GitHub repository. Issues labeled by |
I forked an existing sandbox and edited the vite.config and postcss.config giving me the same results. |
https://vitejs.dev/config/#css-postcss
So it is a directory path. https://github.com/postcss/postcss-load-config#usage So for your use case, please either use a canonical configuration file and put conditional loading logic in it, or pass an inline config. |
The Vite documentation isn't very clear on this, so I marked this issue as a documentation one. |
I prefer using inline instead of another package. When using inline i get following error trying to load the app (so not when compiling and running the localhost server)
My inline configuration (can't use required i think because i use esm build))
EDIT
Please update documentation with an example. |
Describe the bug
Having multiple app builds i need multiple postcss config's,
I tried using inline postcss configuration and linking to a file. Non of that works.
Adding a postcss.config.js to the root does work, but i can't use that since i have other vite.config's that need different postcss config files and have different configurations
Reproduction
I'm using Vite + Vue2
System Info
System:
OS: macOS 11.3
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 303.24 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
Browsers:
Brave Browser: 91.1.25.68
Firefox: 89.0
Safari: 14.1
npmPackages:
vite: ^2.3.4 => 2.3.4
The text was updated successfully, but these errors were encountered: