webpack / webpack/webpack-bundle-analyzer

No Parsed/Gziped sizes if there is build hash in output path

Open
#297 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

flag: Has pull request severity: 3 (broken) type: Bug type: Feature
Dominant language
JavaScript
Stars
12.7k
Forks
514
Avg merge
6d 2h
Merged PRs (30d)
4

Description

Issue description

If there as build hash in webpack's output path, I get following error from WBA:
Error parsing bundle asset "/xxx/app/dist/[hash]/app.js": no such file.

My webpack output config:

	output: {
		filename: '[name].js',
		path: path.join(__dirname, './dist/[hash]/'),
		publicPath: `${cdnPublicPath}[hash]/`,
		chunkFilename: '[name].js',
	},

This causes that there is no gziped/parsed size on the WBA page.

Technical info
  • Webpack Bundle Analyzer version: 3.3.2
  • Webpack version: 4.35.0
  • Node.js version: 10.13
  • npm/yarn version: npm 6.9
  • OS: Mac OS Mojave
Debug info

How do you use this module? As CLI utility or as plugin?
Plugin

If plugin, what options were provided? (e.g. new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true }))
No options

What other Webpack plugins were used?
webpack.DefinePlugin
CircularDependencyPlugin
FlowStatusWebpackPlugin
ExtractCssChunks
HtmlWebpackPlugin
SpriteLoaderPlugin

Demo repo

https://github.com/martinkadlec0/wba-build-hash

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked wba-build-hash demo repo and reproduce the plugin error using the webpack output path containing [hash]. Trace how the analyzer resolves the emitted asset path; done means hashed output assets are parsed and their parsed and gzipped sizes appear on the analyzer page.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.