bootstrap-loader icon indicating copy to clipboard operation
bootstrap-loader copied to clipboard

No PostCSS config

Open thepatrick opened this issue 8 years ago • 12 comments

A fresh install fails today with the postcoss-loader unless I create node_modules/bootstrap-loader/postcss.config.js with the contents module.exports={};

thepatrick avatar Jan 17 '17 11:01 thepatrick

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"
  }
}

killtheliterate avatar Jan 17 '17 23:01 killtheliterate

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 😢

killtheliterate avatar Jan 17 '17 23:01 killtheliterate

@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.

justin808 avatar Jan 18 '17 04:01 justin808

Please let me know what your findings are. I'm happy to consider a PR.

justin808 avatar Jan 29 '17 21:01 justin808

@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.

killtheliterate avatar Jan 30 '17 20:01 killtheliterate

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?

killtheliterate avatar Jan 30 '17 20:01 killtheliterate

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 avatar Feb 05 '17 05:02 nicluo

@nicluo i am getting this as an issue, but i see it's over two months old, any update on this?

borysn avatar Mar 10 '17 20:03 borysn

@nicluo nvm, i was confused about setting up postcss.config.js, but only adding module.exports = {}; runs fine.

borysn avatar Mar 10 '17 21:03 borysn

I asked @killtheliterate to submit a PR. I'll happily merge a PR on this one.

justin808 avatar Apr 06 '17 08:04 justin808

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.

giggio avatar Apr 06 '17 17:04 giggio

@justin808 just reopened #241

killtheliterate avatar Apr 06 '17 17:04 killtheliterate