Skip to content

Commit 0459f23

Browse files
authored
docs: add badges to README (#2)
1 parent 1aa62c6 commit 0459f23

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
# @rspack/plugin-react-refresh
77

8+
<p>
9+
<a href="https://www.npmjs.com/package/@@rspack/plugin-react-refresh?activeTab=readme"><img src="https://img.shields.io/npm/v/@@rspack/plugin-react-refresh?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" /></a>
10+
<a href="https://npmcharts.com/compare/@@rspack/plugin-react-refresh?minimal=true"><img src="https://img.shields.io/npm/dm/@@rspack/plugin-react-refresh.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
11+
<a href="https://github.com/web-infra-dev/rspack/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" /></a>
12+
</p>
13+
814
React refresh plugin for [Rspack](https://github.com/web-infra-dev/rspack).
915

1016
## Installation
@@ -29,8 +35,8 @@ Enabling [React Fast Refresh](https://reactnative.dev/docs/fast-refresh) functio
2935
- Code transformation can be added through loaders, such as [jsc.transform.react.refresh](https://swc.rs/docs/configuration/compilation#jsctransformreactrefresh) for [swc-loader](https://swc.rs/docs/usage/swc-loader) or the [react-refresh/babel](https://github.com/facebook/react/tree/main/packages/react-refresh) for [babel-loader](https://github.com/babel/babel-loader).
3036

3137
```js
32-
const ReactRefreshPlugin = require('@rspack/plugin-react-refresh');
33-
const isDev = process.env.NODE_ENV === 'development';
38+
const ReactRefreshPlugin = require("@rspack/plugin-react-refresh");
39+
const isDev = process.env.NODE_ENV === "development";
3440

3541
module.exports = {
3642
experiments: {
@@ -39,17 +45,17 @@ module.exports = {
3945
},
4046
},
4147
// ...
42-
mode: isDev ? 'development' : 'production',
48+
mode: isDev ? "development" : "production",
4349
module: {
4450
rules: [
4551
{
4652
test: /\.jsx$/,
4753
use: {
48-
loader: 'builtin:swc-loader',
54+
loader: "builtin:swc-loader",
4955
options: {
5056
jsc: {
5157
parser: {
52-
syntax: 'ecmascript',
58+
syntax: "ecmascript",
5359
jsx: true,
5460
},
5561
transform: {
@@ -81,4 +87,4 @@ Thanks to the [react-refresh-webpack-plugin](https://github.com/pmmmwh/react-ref
8187

8288
## License
8389

84-
Rspack is [MIT licensed](https://github.com/web-infra-dev/rspack/blob/main/LICENSE).
90+
`@rspack/plugin-react-refresh` is [MIT licensed](https://github.com/web-infra-dev/rspack/blob/main/LICENSE).

0 commit comments

Comments
 (0)