Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

parsed sizes not working for utf8 with bom files #282

Open
nextgennexia opened this issue May 16, 2019 · 3 comments
Open

parsed sizes not working for utf8 with bom files #282

nextgennexia opened this issue May 16, 2019 · 3 comments

Comments

@nextgennexia
Copy link

Issue description

Parsed sizes not working for utf8 with bom files

Technical info

  • Webpack Bundle Analyzer version: 3.0.3
  • Webpack version: 4.25.1
  • Node.js version: 10.15.3
  • npm version: 6.9.0
  • OS: win10

Debug info

const BomPlugin = require("webpack-utf8-bom");
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;

plugins: [
		new BomPlugin(true),
		new BundleAnalyzerPlugin({
			analyzerMode: "static",
			openAnalyzer: false,
		}),
		...
	],
@th0r
Copy link
Collaborator

th0r commented May 16, 2019

What do you mean by "not working"? What error it shows? Could you create a minimal reproduction repo?

@nextgennexia
Copy link
Author

@valscion
Copy link
Member

So it looks like when the generated output contains a BOM mark:

Screenshot_16_05_2019__14_48

The generated chartData looks like this: https://github.com/nextgennexia/bundleAnalyzerWithBom/blob/f8909a47bf1def86e08653269ea02e1712d91710/bundles/report.html#L59

window.chartData = [
  {
    label: 'SearchResults.js',
    isAsset: true,
    statSize: 20,
    parsedSize: 0,
    gzipSize: 20,
    groups: [{ id: 0, label: 'index.js', path: './index.js', statSize: 20 }]
  }
];

So for some reason the parsedSize ends up being 0 for the input module https://github.com/nextgennexia/bundleAnalyzerWithBom/blob/f8909a47bf1def86e08653269ea02e1712d91710/index.js#L1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants