Skip to content

A Babel plugin that adds Webpack magic comments to provide chunk names on dynamic imports

License

Notifications You must be signed in to change notification settings

rschristian/babel-plugin-webpack-chunk-name-comments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@rschristian/babel-plugin-webpack-chunk-name-comments

A Babel plugin that adds Webpack magic comments to provide chunk names on import() statements.

Usage

In your babel configuration (.babelrc, babel.config.json, etc.) add the plugin:

{
    "plugins": [
        "@rschristian/babel-plugin-webpack-chunk-name-comments"
    ]
}
// input:
import("./a.js");

// output:
import(
    /*webpackChunkName: "a"*/
    "./a.js"
);

For more information on magic comments and how they might be used, see Webpack's docs on the subject.

License

MIT

Modified from Widen Enterprises, Inc. MIT

Acknowledgments

Modified version of babel-plugin-dynamic-import-chunk-name, built specifically for preact-cli

About

A Babel plugin that adds Webpack magic comments to provide chunk names on dynamic imports

Resources

License

Stars

Watchers

Forks