mummybot / postcss-strip-inline-comments

Remove inline comments from postcss-scss parser
MIT License
31 stars 3 forks source link

TypeError: css.walkAtRules is not a function #7

Closed catamphetamine closed 6 years ago

catamphetamine commented 6 years ago

Does it support the latest PostCSS 6? Using postcss-comment instead.

mummybot commented 6 years ago

I have just been working on a project which uses PostCSS 6, and have just upgraded to 7 and it still works fine. Have you set a parser in your configuration?

If not, can you please share your tooling config?

catamphetamine commented 6 years ago

Oh, they already have 7.

It was a long time ago so I don't know what was it exactly, but here's the config if you want: https://github.com/catamphetamine/webpack-react-redux-server-side-render-example/blob/master/.postcssrc

mummybot commented 6 years ago

You have to add a parser to the webpack configuration: https://github.com/catamphetamine/webpack-react-redux-server-side-render-example/blob/master/webpack/webpack.config.js#L61

loader: ExtractTextPlugin.extract('style-loader', 'css-loader?sourceMap&importLoaders=1!postcss-loader?parser=postcss-scss')

Because it is a 'comment' the AST generated by PostCSS alone doesn't capture the non-standard i.e. // string.

Sorry it took awhile to reply 😆