bootstrap-loader
bootstrap-loader copied to clipboard
No PostCSS config
A fresh install fails today with the postcoss-loader unless I create node_modules/bootstrap-loader/postcss.config.js with the contents module.exports={};
Temporary fix that I've adopted follows.
post-install.sh:
#!/bin/bash
echo "module.exports = {}" >> node_modules/bootstrap-loader/postcss.config.js
package.json:
{
...
"scripts": {
"postinstall": "./post-install.sh"
}
}
I don't think bootstrap-loader actually has much to do with postcss, since it's not a dependency. I am using postcss-loader, and while your fix works in a simple case, I get similar explosions about postcss in all my css directories. Weird 😢
@thepatrick, can you try #241.
I really have no idea why that file would fix the issue. If I can get an explanation, then I'd be happy to merge.
Please let me know what your findings are. I'm happy to consider a PR.
@justin808 will do. I don't think #241 is going to work, because once I get past the first hiccup, the same error occurs for many app-side directories that have CSS.
So, not really sure where this issue belongs, but because folks have been talking about it here...
My build started working again when I moved my postCSS config out of webpack.config and into a postcss.config.js. @thepatrick are you also using that method to load postcss plugins?
PostCSS config is loaded via github.com/michael-ciniawsky/postcss-load-config. 25 days ago, an update made postcss.config.js mandatory by throwing the error rather than just logging in console. https://github.com/michael-ciniawsky/postcss-load-config/commit/a6c32fd
If you only use postcss-loader within bootstrap-loader (as part of the list of loaders in .bootstraprc), then node_modules/bootstrap-loader/postcss.config.js is all you need. If you use the loader in your own css, then you need a postcss.config.js in the project root as well.
https://github.com/killtheliterate/bootstrap-loader/commit/7b80e4547b8a0beef660d6c28c323f1ae84b862b resolves the problem for the former case. I think it should be merged. 👍🏻
@nicluo i am getting this as an issue, but i see it's over two months old, any update on this?
@nicluo nvm, i was confused about setting up postcss.config.js, but only adding module.exports = {}; runs fine.
I asked @killtheliterate to submit a PR. I'll happily merge a PR on this one.
Just downgrade postcss-loader to 1.2.1 and add postcss-load-config version 1.0.0 to your package.json, and you are good to go, until they fix things on bootstrap-loader.
@justin808 just reopened #241