An open API service indexing awesome lists of open source software.

https://github.com/jiangweixian/vite-plugin-magic-comments


https://github.com/jiangweixian/vite-plugin-magic-comments

magic-comments vite vite-plugin webpack

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

          

# vite-plugin-magic-comments
> Similar works like https://webpack.js.org/api/module-methods/#magic-comments

Most codes inspired from

Support follow magic comments:

- `webpackChunkName` or `chunkName` - define chunk name
- `webpackPrefetch` or `prefetch` - transform `index.html`, add prefetch link into html meta
- `webpackPreload` or `preload` - transform `index.html`, add preload link into html meta

## usage

```ts
import(
/* webpackChunkName: my-chunk-name */
/* webpackPreload: true */
/* webpackPrefetch: true */
"module"
)
```