Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Upstream issue in html-minified-terser: <meta name="viewport" content="width=device-width initial-scale=1"> is incorrectly minified #106

Open
davidmurdoch opened this issue Aug 1, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@davidmurdoch
Copy link

Just linking it here so it can be more easily tracked, and others that might be affected when using html-bundler-webpack-plugin can more easily find it here.

Upstream issue: terser/html-minifier-terser#178

@webdiscus
Copy link
Owner

@davidmurdoch thanks for the link to the issue.

@webdiscus
Copy link
Owner

webdiscus commented Aug 1, 2024

@davidmurdoch

Alternatively, can be used another minify lib.

Just disable build-in minify option: minify: false and use the postprocess callback option with other minify:

const HtmlBundlerPlugin = require('html-bundler-webpack-plugin');
const myMinify = require('ANY-MINIFY-PACKAGE'); // <= install another minify package

module.exports = {
  plugins: [
    new HtmlBundlerPlugin({
      entry: {
        index: './src/home.html',
      },
      minify: false, // <= disable build-in minify
      postprocess: (content) => myMinify(content), // <= use custom minify function
    }),
  ],
};

davidmurdoch added a commit to MetaMask/metamask-extension that referenced this issue Aug 2, 2024
…26268)

The functionality is the same as before, but it this change works around
a bug in https://github.com/terser/html-minifier-terser which causes the
space to be removed, and the tag to become invalid (this only affects
the webpack build).

Upstream issues:

webdiscus/html-bundler-webpack-plugin#106
terser/html-minifier-terser#178
@webdiscus webdiscus added the documentation Improvements or additions to documentation label Aug 8, 2024
dawnseeker8 pushed a commit to MetaMask/metamask-extension that referenced this issue Aug 12, 2024
…26268)

The functionality is the same as before, but it this change works around
a bug in https://github.com/terser/html-minifier-terser which causes the
space to be removed, and the tag to become invalid (this only affects
the webpack build).

Upstream issues:

webdiscus/html-bundler-webpack-plugin#106
terser/html-minifier-terser#178
@webdiscus webdiscus added this to the backlog milestone Aug 16, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants