babel-plugin-webpack-prefetch
Babel plugin for adding webpackPrefetch comment.
![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)
Usage
yarn add -D babel-plugin-webpack-prefetch
then add babel-plugin-webpack-prefetch
to your .babelrc
{
"plugins": [
+ "babel-plugin-webpack-prefetch"
]
}
And it does :
import ccc from 'ddd'
import 'aaa'
const a = import(
+ /* webpackPrefetch: true */
'aaa'
)
const b = import(
+ /* webpackPrefetch: true */
'bbb'
)
babel-plugin-webpack-prefetch
will respect your comment :
const a = import(
// you added webpackPrefetch: false so babel-plugin-webpack-prefetch will not modify it
/* webpackPrefetch: false */
'aaa'
)
const b = import(
+ /* webpackPrefetch: true */
'bbb'
)