Open steverandy opened 4 years ago
This bug should be fixed in v0.2.3 Try updating to use that version in your package.json.
I just tried and getting the following error message:
hmmm. Thanks @steverandy. Would it be possible to share any info about the site you are using this on? Is it in a public repo anywhere?
The repo is private.
This is the netlify.toml config that I use:
[build]
publish = "public"
command = "npm run build"
[build.environment]
NODE_VERSION = "12.16.3"
NODE_OPTIONS = "--max_old_space_size=4096"
GATSBY_TELEMETRY_DISABLED = "1"
[[plugins]]
package = "netlify-plugin-gatsby-cache"
[[plugins]]
package = "netlify-plugin-minify-html"
[plugins.inputs]
contexts = ["production", "branch-deploy", "deploy-preview"]
[plugins.inputs.minifierOptions]
minifyJS = true
minifyCSS = true
removeComments = true
collapseWhitespace = true
Not seeing anything untoward in your toml. Tricky to debug without more insight into the site itself since I can't replicate this issue. Are you able to perform a build locally via the netlify cli which would also run the build locally for you?
# install the Netlify CLI
npm i --g netlify-cli
# run a Netlify build from your project directory
netlify build
It would be interesting to know if this works locally.
Got the same error on local build.
However, it works if I set the sync option
comp({
compressor: htmlMinifier,
input: constants.PUBLISH_DIR + '/**/*.html',
output: '$1.html',
replaceInPlace: true,
options: inputs.minifierOptions,
sync: true
});
If you're using Gatsby, there is a directory that gets produced that throws an error due to no file check in the version of the underlying package. I submitted a fix that I submitted to repository a year ago, but it hasn't been merged yet: https://github.com/srod/node-minify/pull/1117
The config that I use:
It looks like the plugin does not work and netlify serves the original html. Not sure what I'm missing. Can you help? Thanks.