Webpack/PostCSS is unable to process .pcss files which have inline comments:
Module build failed: Syntax Error
(77:5) Unknown word > 77 | // } | ^
PostCSS part of my Webpack's config:
let PostCSSConfig = {
sourceMap: true,
plugins: () => [
require('postcss-smart-import'),
require('precss')({}),
require('postcss-for')({}),
require('postcss-mixins')({}),
require('postcss-math')({}),
require('postcss-percentage')({}),
require('postcss-flexbugs-fixes')({}),
require('postcss-cssnext')({browsers: ['> 0.05%', 'IE 7'], cascade: false})
]
};
config.module.rules:
{
test: /\.pcss$/,
exclude: inlineCSS,
use: ExtractTextPlugin.extract({
use: [{
loader: 'css-loader',
options: {
sourceMap: true
}
},
{
loader: 'postcss-loader',
options: PostCSSConfig
}
]
})
}
I tried using following plugins:
- postcss-comment
- postcss-inline-comment
- postcss-scss
- postcss-strip-comments
but none helped, I had errors every time.
//
comments in CSS or it's just a typo? – Pearlstein//
. – Sheilahshekel