babel plugin for adding webpackPrefetch comment
MIT License
Babel plugin for adding webpackPrefetch comment.
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'
)