Registry / devops / webpack-async-chunk-names-plugin

webpack-async-chunk-names-plugin

JSON →
library0.1.1jsnpmunverified

A webpack plugin that names on-demand chunks created by System.import() or import() by parsing the requested filename. Current version 0.1.1 is marked as WIP with expected bugs and breaking changes. It attempts to guess chunk names automatically, but has no active development or maintenance. Key differentiators: lightweight, zero-config plugin for naming async chunks. Compared to webpack's built-in chunk naming, this plugin tries to infer names from file paths.

npm install webpack-async-chunk-names-plugin
INSTALL
IMPORT
SIG · WEBPACK-ASYNC-CHUN
W
webpack-async-chunk-names-plugin
devopsjavascriptv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AsyncChunkNames
const AsyncChunkNames = require('webpack-async-chunk-names-plugin');
import AsyncChunkNames from 'webpack-async-chunk-names-plugin';
Package does not ship ESM; only CommonJS is supported.
new AsyncChunkNames()
new AsyncChunkNames()
Plugin is instantiated with no options; no constructor arguments are supported.
async chunk naming
Use as plugin in webpack config: plugins: [new AsyncChunkNames()]
Set output.chunkFilename without plugin or use webpack's default naming functions
Plugin must be added to plugins array; chunkFilename must be set in output config.

Adds AsyncChunkNames plugin to webpack config, requiring output.chunkFilename to use [name] placeholder.

const AsyncChunkNames = require('webpack-async-chunk-names-plugin'); module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', chunkFilename: '[name].[chunkhash].js' }, plugins: [ new AsyncChunkNames() ] };
Debug
Known issues
gotchaPackage is marked as WIP and likely unmaintained; expect bugs and breaking changes.
fix
Consider alternative plugins or webpack built-in chunk naming.
affects: >=0.0.0
breakingRequires webpack 2.x beta; incompatible with webpack 3+
fix
If using webpack >=3, do not use this plugin; use webpack's default [name] via output.chunkFilename.
affects: >=0.0.0
gotchaChunk name guessing may not work for all dynamic import patterns; may produce incorrect names.
fix
Ensure import paths are straightforward; test chunk naming in output.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'webpack-async-chunk-names-plugin'
Package not installed or not listed in dependencies
fix
npm install webpack-async-chunk-names-plugin --save-dev
TypeError: AsyncChunkNames is not a constructor
Incorrect import: using ESM import instead of require
fix
Use const AsyncChunkNames = require('webpack-async-chunk-names-plugin');
Error: Only [name] placeholder is supported in chunkFilename
Plugin expects [name] in output.chunkFilename; other placeholders may not work
fix
Set output.chunkFilename to something like '[name].[chunkhash].js'
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
webpackrequiredpeer dependency, requires webpack ^2.1.0-beta.22 or compatible
Agent activity
6 hits · last 30 days
node
6
Resources
webpack-async-chunk-names-plugin — npm install webpack-async-chunk-names-plugin · libregistry