-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
.postcssrc.js not work in monorepo situation #1462
Comments
We will make |
I have met same issue before with a monorepo project. Actually It's because yarn workspace is using different mechanism to resolve dependencies rather than lerna + npm. Yarn will hoist all your dependencies to your project root. If you try to use lerna with npm client in your provided repo, you will find it works fine. Good news is, yarn workspace support a {
"private": true,
"devDependencies": {
"lerna": "^2.11.0"
},
"workspaces": {
"packages": ["packages/*"],
"nohoist": ["**/element-ui"]
}
} |
@yyx990803 @jkzing thank you both, I'll try |
closed via 0ba111e |
@zhangbobell, how did you utilize the new |
@yyx990803, this solution doesn't work for me, only placing |
This worked for me, but bear in mind that the config used in module.exports = {
css: {
loaderOptions: {
postcss: {
plugins: [
require('autoprefixer')()
]
}
}
}
}; |
@mattnathan I said that my example did not work ;) |
Ha, of course. I was hoping to help out by changing the example into one that did work (for me at least) in case some future person stumbled across this issue/thread and didn't have the time to work out the correct way to do it... mostly because I expect that person will be me in a few months time! |
I just ran into this as well. I use Workspaces, so eventually I figured out PostCSS is looking for a config file at the root workspace, where // https://github.com/vuejs/vue-cli/issues/1462
// https://github.com/postcss/postcss/issues/1190
// https://github.com/postcss/postcss/issues/1205
module.exports = {} I usually add links to related issues, to reason why this file is necessary. I should also mention I didn't have to go through this for a React based project that uses a similar CSS import (that raised this error), so I'm guessing it's something with how PostCSS is integrated into |
Version
3.0.0-beta.15
Reproduction link
https://github.com/zhangbobell/vue-cli-lerna-reproduce
Steps to reproduce
git clone https://github.com/zhangbobell/vue-cli-lerna-reproduce.git
cd vue-cli-lerna-reproduce
yarn
cd packages/sample && yarn serve
What is expected?
runs well
What is actually happening?
broken since postcss error
About my repos
lerna
to manage monorepo include a repo create byvue-cli
element-ui
, import it js and csspostcss-loader
has expose a options calledpath
to specify the path of config file, butvue-cli-service
only pass insourceMap
optionTried solution
vue.config.js
to override the config but failed, since it's not allowed, main because it's a internal configpostcss-load-config
does not provide path options, cannot use the solution posted in the docs.postcssrc.js
in lerna root dir or addpostcss
section to root package.json will solve this, but I think it's not a elegant solutionSo, would you please provide a elegant solution about this problem ?
Thanks very much !
The text was updated successfully, but these errors were encountered: