critters
critters copied to clipboard
Critters is commenting out any php in the file
Critters succeeds in inlining the css and preloading the link tag, but it also comments out any other php lines on the file, both in the head and body of the document.
I am using Critters with html-webpack-plugin
and mini-css-extract-plugin
in an mpa.
Here's a relevant chunk of my config:
module.exports = {
module: {
rules: [
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"sass-loader"
]
}
]
},
plugins: [
new HtmlWebpackPlugin({
chunks: ['common', 'index'],
filename: 'index.php',
template: './src/pages/_index.php'
}),
new Critters(),
]
};
@CathyMacars
I'm hitting a similar issue, perhaps. Are you running a vanilla PHP website? I'm trying to integrate critters with a Wordpress them and I'm running into trouble: https://github.com/GoogleChromeLabs/critters/issues/16
@jcklpe
Yep... vanilla PHP.
Doing the same here, turning something like this:
<?php if ($something === true): ?>
into this:
<!--?php if ($something === true): ?-->