Skip to content

Commit

Permalink
feat: basic implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Jul 2, 2024
1 parent 5f52e21 commit 23880bc
Show file tree
Hide file tree
Showing 8 changed files with 1,092 additions and 40 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# rsbuild-plugin-example
# @rsbuild/plugin-node-polyfill

rsbuild-plugin-example is a Rsbuild plugin to do something.
@rsbuild/plugin-node-polyfill is a Rsbuild plugin to do something.

<p>
<a href="https://npmjs.com/package/rsbuild-plugin-example">
<img src="https://img.shields.io/npm/v/rsbuild-plugin-example?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
<a href="https://npmjs.com/package/@rsbuild/plugin-node-polyfill">
<img src="https://img.shields.io/npm/v/@rsbuild/plugin-node-polyfill?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
</a>
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
</p>
Expand All @@ -14,17 +14,17 @@ rsbuild-plugin-example is a Rsbuild plugin to do something.
Install:

```bash
npm add rsbuild-plugin-example -D
npm add @rsbuild/plugin-node-polyfill -D
```

Add plugin to your `rsbuild.config.ts`:

```ts
// rsbuild.config.ts
import { pluginExample } from "rsbuild-plugin-example";
import { pluginNodePolyfill } from "@rsbuild/plugin-node-polyfill";

export default {
plugins: [pluginExample()],
plugins: [pluginNodePolyfill()],
};
```

Expand All @@ -39,7 +39,7 @@ Some description.
- Example:

```js
pluginExample({
pluginNodePolyfill({
foo: "bar",
});
```
Expand Down
27 changes: 26 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "rsbuild-plugin-example",
"name": "@rsbuild/plugin-node-polyfill",
"version": "0.0.0",
"repository": "https://github.com/rspack-contrib/rsbuild-plugin-template",
"license": "MIT",
Expand Down Expand Up @@ -31,6 +31,31 @@
"biome check --write --no-errors-on-unmatched"
]
},
"dependencies": {
"assert": "^2.1.0",
"browserify-zlib": "^0.2.0",
"buffer": "^5.7.1",
"console-browserify": "^1.2.0",
"constants-browserify": "^1.0.0",
"crypto-browserify": "^3.12.0",
"domain-browser": "^5.7.0",
"events": "^3.3.0",
"https-browserify": "^1.0.0",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"punycode": "^2.3.1",
"querystring-es3": "^0.2.1",
"readable-stream": "^4.5.2",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"string_decoder": "^1.3.0",
"timers-browserify": "^2.0.12",
"tty-browserify": "^0.0.1",
"url": "^0.11.3",
"util": "^0.12.5",
"vm-browserify": "^1.1.2"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@playwright/test": "^1.44.1",
Expand Down
4 changes: 2 additions & 2 deletions playground/rsbuild.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from '@rsbuild/core';
import { pluginExample } from '../src';
import { pluginNodePolyfill } from '../src';

export default defineConfig({
plugins: [pluginExample()],
plugins: [pluginNodePolyfill()],
});
Loading

0 comments on commit 23880bc

Please sign in to comment.