https://github.com/LonelySnowman/rspack-deno-plugin
Make rspack run correctly in the deno environment.
https://github.com/LonelySnowman/rspack-deno-plugin
Last synced: 2 months ago
JSON representation
Make rspack run correctly in the deno environment.
- Host: GitHub
- URL: https://github.com/LonelySnowman/rspack-deno-plugin
- Owner: LonelySnowman
- License: mit
- Created: 2025-01-31T11:24:58.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-02-09T17:02:30.000Z (2 months ago)
- Last Synced: 2025-02-09T17:34:50.060Z (2 months ago)
- Language: TypeScript
- Size: 97.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rspack - rspack-deno-plugin
README
# rspack-deno-plugin
Deno module resolution for rspack and rsbuild.
- Support for `http:`, `https:`, `jsr:`, and `npm:` specifiers.
> This project learns [esbuild_deno_loader](https://github.com/lucacasonato/esbuild_deno_loader)
## How to use
- You need to set `"nodeModulesDir": "auto"` in deno.json before start.
```bash
# install package
deno install jsr:@snowman/rspack-deno-plugin
``````ts
// create rsbuild script file like rsbuild-script.ts
import { createRsbuild } from '@rsbuild/core';
import RspackDenoPlugin from '@snowman/rspack-deno-plugin';const rsbuild = await createRsbuild({
rsbuildConfig: {
tools: {
rspack: {
// add rspack plugin
plugins: [new RspackDenoPlugin()],
},
},
},
});// build
await rsbuild.build();// preview
await rsbuild.preview();// dev
await rsbuild.startDevServer();
``````bash
# run rsbuild script
deno --allow-all ./rsbuild-script.ts
```## How it works
- `npm:` specifier: Resolve node_modules like node.
- `http:`, `https:`, `jsr:` specifiers: Use `deno info` command to resolve deno local cache.
- `file:`, `data:` specifiers: Resolve by rspack.## Coming soon
- [ ] Support resolve npm local deno cache.
- [ ] Add test code and CI/CD.