A Babel plugin that adds Webpack magic comments to provide chunk names on import()
statements.
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.
Modified from Widen Enterprises, Inc. MIT
Modified version of babel-plugin-dynamic-import-chunk-name
, built specifically for preact-cli