Open ctaepper opened 8 years ago
Hi @ctaepper!
I was just writing some instructions when it appeared to me that right now the postcss-debug code might not yet handle the dynamic nature of webpack incl. changing file contents properly.
We will have to fix this. In the meantime... Can I suggest using the postcss-debug CLI for now?
Just add a .postcss.js
file to set up your postcss plugins as described here: https://github.com/andywer/postcss-debug#cli
Sorry for the inconvenience!
no worries, will do that... mind keeping this issue open in the meantime? PS: i like your postcss repos ;-)
Sure, let's keep it open as a reminder for now.
Btw: Thanks! I am glad about your feedback, too. I always start by the assumption that it's easy to solve and then recognize it's not ;)
I am still thinking about it... I see multiple problems for the webpack scenario (which is a shame, since I like webpack and many people use it).
Like
postcss-loader
+ css-loader
with css modules support)(Just wanted to write my current thoughts down, so they don't get lost ;) )
i don't know anything about neither dev-server internals nor postcss debugger internals ... but shouldn't it be possible to make the dev-server serve the debugger under a special path? like server:port/_postcss_debugger (assuming the debugger-ui is a static tool?)
Serving the debugger is not the problem. But updating the debugger view when the dev-server re-compiles a changed css file is. Plus: If a file is processed by two different postcss instances (like postcss-loader + css-loader w/ css modules) then we might run into issues, too, since the debugger assumes that files are only processed by postcss once...
Didn't forget you. I think I know how to implement better and more dynamical webpack support, but it's not going to be as nice as I would like it to be. And I barely have the time to implement it...
So my suggestion for now (btw this is how I currently do it [also in a webpack-based setup]): Just use the postcss-debugger CLI 🙈😉
i got the debug function working, but i have no idea how or where to add .inspect() method and where to access the ui?