Babel plugin (v1.3.1, last updated 2020) that automatically names dynamic import chunks based on the file path, removing the need for manual webpackChunkName magic comments. It transforms import() to include webpackChunkName derived from the imported module's filename or directory structure. Options include 'delay' mode which wraps import in a function for lazy evaluation. Differentiates from manual comments and NamedChunksPlugin by automating chunk naming with zero configuration, preserving folder structure in output.
npm install babel-plugin-path-chunk-nameVerified import paths — ran on the pinned version, not inferred.
Shows basic usage in .babelrc, default path-to-chunk-name transformation, delay mode wrapping, and dynamic import pattern.
Ensure dynamic paths are structured to generate desired chunk names, or use magic comments manually for fine control.
If using .then(), do not enable delay, or wrap import in a function manually to preserve lazy behavior.
Remove existing delay wrappers if you want the plugin to handle delay, or ensure consistency.
Consider alternative chunk naming strategies if upgrading Babel breaks the plugin.
Run `npm install babel-plugin-path-chunk-name --save-dev` and ensure it's in node_modules.
Use require() or string name in Babel config; avoid ESM imports for config.
Use nesting array: `[["path-chunk-name", { opts }]]`.No dependency data recorded yet.