-
-
Notifications
You must be signed in to change notification settings - Fork 188
Importing nested css is not transpired #326
Comments
loader: ExtractTextPlugin.extract('style-loader', 'css-loader', 'postcss-loader') should be loader: ExtractTextPlugin.extract('style-loader', [ 'css-loader', 'postcss-loader' ])
// or
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader') |
Hey thanks for the response. But that didn't work. I simplified my example and put it on https://github.com/amir20/example-bug-326. The broken output is here, and I have modified webpack.config.js as you suggested. I also tried Could this be a bug @MoOx? I can't reopen. |
No this is definitely not a cssnext bug. And lot's of people and config are doing a classic postcss + postcss-import + postcss-cssnext without any problem. It's more a configuration issue ;) |
ExtractTextPlugin.extract() take 2 args in wepback 1, an object in webpack 2 version. Just check that something in the root is transpiled. |
I am have done |
I am going to try without |
Also try with more simple features without import. |
Good news, it works without |
Problem solved. I was missing |
You are not supposed to use this option when you use postcss-import. |
Is that documented somewhere? Honestly, I was trying to understand what is all the fuss about PostCSS when compared to other frameworks. I find PostCSS really powerful, but having to figure out why something is not working and then digging to the six plugins I am using feel a step back in direction of web development. Then again that's just my opinion. |
You are mixing webpack and postcss. Just try vanilla postcss, then integrate it to webpack. |
In the documentation it says
I read the documentation. I also followed it correctly. I think you are missing what I am saying. I am not saying this is PostCSS or even this module's problem. I am saying back in 2010, I would include less, stylus, sass, etc... and with minimal effort you would get things to work. Now, the options are endless and we can add so many things. But it comes at a cost where not all modules are compatible with each. I was trying to evaluate this at work. It feels like the JavaScript community is moving away from opinionated frameworks to having everything configured. I have probably spend 6 hours on this. It's probably my fault because I didn't know what to google. But at some point, I thought, this can't be this hard. I didn't find a single example of extract + webpack + postcss + postcss-next. As a software engineer with 10 years of experience, that is frustrating. Anyway, thanks for the help. Maybe I am just alone in this thought. I have read so many documents. |
I totally agree with you. I barely use postcss this days since I use javascript solution to write my styles. But in comparison to postcss, babel does offer an easy way to setup. Postcss should have a website with a page to show classic example (like webpack + postcss). They started to make a website, but there is only a homepage, nothing more... poke @ai. |
Thanks @MoOx. I did a little investigation. I wanted to know where I got the syntax and why I missed this. I googled "ExtractTextPlugin postcss with webpack" which led me to this page. It didn't work, I tried doing webpack2 search which led me to this page. That didn't work. I see what you were saying now that in PostCss README example says to use So to wrap things up. Lesson learned here is that I should have first tried to gotten it to work without All this webpack/js/postcss is moving so fast that README files become outdated within weeks, especially with webpack2 coming out. Thanks for being patient. :) Looking forward to see an actual homepage with how to use it with babel. |
Hello, I am new to PostCSS. I am getting a strange behavior with this module which I expect it to work. I have a simple project that looks like:
app.js
app.css
header.css
The issue is that
header.css
is never transpiled. I was using webpack2 at first but then I gave up and started using webpack1 and I still see the same problem.Including
header.css
fromapp.js
does work.webpack.config.js
What am I doing wrong?
The text was updated successfully, but these errors were encountered: