question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature proposal: Option to turn off automatic chunk naming

See original GitHub issue

🚀 Feature Proposal

Add a new option to the Babel plugin to turn off automatic chunk naming.

Motivation

The Babel plugin currently does two things, add SSR support and automatically add chunk naming via a magic Webpack comments. In some cases, you might only want to add the SSR support, but not add readable names to the chunks.

For example, with Webpack’s split chunks, the chunk names will also affect the file names, and you might not want to expose the names of the chunks to the end users for various reasons (I also think having chunk names can in some cases affect how Webpack splits chunks). Even with Webpack 5s prod-default ‘deterministic’ option will still preserve these chunk names because they were added via a magic comment.

Example

new LoadablePlugin({ automaticChunkNames: false })

Pitch

There are valid cases where you don’t want automatic chunk names and this feature makes sense/can only be implemented inside of Loadable itself. It’s also a minimal API to both implement and maintain in the future, so no real downsides. This API also enables having chunk names in dev, but avoiding them in prod. Keeping the default to true makes this a non-breaking change.

If there is interest I could probably find time to try implementing this.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
theKasheycommented, Apr 12, 2021

Yes, this is more about implementation detail rather than a feature.

It’s still not a big problem to find a chunk name from the stats. It’s just not how it’s working right now, and it might be not that easy to change this.

From time to time I am thinking about doing a major change with some necessary API updates, and that can be a part of it. One day.

0reactions
stale[bot]commented, Jun 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Micro Frontend Architecture: Import chunks from another ...
This article describes how I wrote a Webpack plugin that imports chunks from other Webpack bundles at runtime. It is part of a...
Read more >
Code Splitting - webpack
Prevent Duplication: Use Entry dependencies or SplitChunksPlugin to dedupe and split chunks. Dynamic Imports: Split code via inline function calls within ...
Read more >
How to turn off HTML input form field suggestions?
What you want is to disable HTML autocomplete Attribute. Setting autocomplete="off" here has two effects: It stops the browser from saving ...
Read more >
namer, Automatic Labelling of R Markdown Chunks
We've just released a sweet package to save you stress from the hassle of unnamed chunks in R Markdown! namer will name all...
Read more >
API - esbuild
You have to explicitly pass the --bundle flag to enable bundling. ... This option is similar to the chunk names and entry names...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found