# babel-plugin-webpack-prefetch

> babel plugin for adding webpackPrefetch comment

Latest version **1.1.0** (published 2018-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-webpack-prefetch
pnpm add babel-plugin-webpack-prefetch
yarn add babel-plugin-webpack-prefetch
bun add babel-plugin-webpack-prefetch
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2018-04-25 |
| First published | 2018-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 2 |
| Unpacked size | 401.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Wu Haotian |
| Maintainers | whtsky |
| Keywords | babel, babel-plugin, webpack, prefetch, preload |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-webpack-prefetch
- Repository: https://github.com/whtsky/babel-plugin-webpack-prefetch
- Homepage: https://github.com/whtsky/babel-plugin-webpack-prefetch#readme
- Issues: https://github.com/whtsky/babel-plugin-webpack-prefetch/issues
- npm.io page: https://npm.io/package/babel-plugin-webpack-prefetch

## Dependencies (2)

- [babel-plugin-syntax-dynamic-import](https://npm.io/package/babel-plugin-syntax-dynamic-import.md) ^6.18.0
- [@babel/plugin-syntax-dynamic-import](https://npm.io/package/@babel/plugin-syntax-dynamic-import.md) ^7.0.0-beta.46

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2018-04-25

## README

# babel-plugin-webpack-prefetch

Babel plugin for adding webpackPrefetch comment.

[![license](https://img.shields.io/npm/l/babel-plugin-webpack-prefetch.svg)](https://github.com/whtsky/babel-plugin-webpack-prefetch/blob/master/LICENSE)
[![npm](https://img.shields.io/npm/v/babel-plugin-webpack-prefetch.svg)](https://www.npmjs.com/package/babel-plugin-webpack-prefetch)
[![Build Status](https://travis-ci.org/whtsky/babel-plugin-webpack-prefetch.svg?branch=master)](https://travis-ci.org/whtsky/babel-plugin-webpack-prefetch)
[![codecov](https://codecov.io/gh/whtsky/babel-plugin-webpack-prefetch/branch/master/graph/badge.svg)](https://codecov.io/gh/whtsky/babel-plugin-webpack-prefetch)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)

## Usage

```bash
yarn add -D babel-plugin-webpack-prefetch
```

then add `babel-plugin-webpack-prefetch` to your `.babelrc`

```diff .babelrc
{
  "plugins": [
+    "babel-plugin-webpack-prefetch"
  ]
}
```

And it does :
```diff a.js
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 :
```diff a.js
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'
)

---
_Source: https://npm.io/package/babel-plugin-webpack-prefetch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
