Babel plugin for After.js that automatically adds webpackChunkName comments and chunkName properties to asyncComponent() calls. Current stable version 3.2.0. This plugin parses import statements for asyncComponent from '@jaredpalmer/after' or '@jaredpalmer/after/asyncComponent', then transforms dynamic import() expressions by adding a deterministic chunkName (based on the import path) alongside any existing webpackChunkName comment. It handles named and default imports, multiple local names, and preserves existing chunkName props. Primarily used within Razzle or After.js projects to optimize code splitting. No known breaking changes across 3.x releases.
npm install babel-plugin-afterVerified import paths — ran on the pinned version, not inferred.
Shows Babel config and transformation of asyncComponent call with automatic webpackChunkName and chunkName assignment.
Ensure asyncComponent is used as the value of a property named 'component' inside an object.
Use the exact import source expected by the plugin.
Provide a custom chunkName prop in asyncComponent options to override.
Run: npm install babel-plugin-after --save-dev
Add '@babel/plugin-syntax-dynamic-import' to your Babel plugins.
Define a proper interface for your route object with a component property of type React.ComponentType.
No dependency data recorded yet.