@gjsify/rolldown-plugin-pnp 0.4.42 → 0.4.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @gjsify/rolldown-plugin-pnp
|
|
2
|
+
|
|
3
|
+
Rolldown/Rollup/Vite plugin that resolves modules through a Yarn Plug'n'Play (`.pnp.cjs`) manifest, so gjsify builds work correctly inside Yarn PnP projects. Automatically no-ops when no PnP root is found.
|
|
4
|
+
|
|
5
|
+
Part of the [gjsify](https://github.com/gjsify/gjsify) project — Node.js and Web APIs for GJS (GNOME JavaScript).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
gjsify install @gjsify/rolldown-plugin-pnp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { defineConfig } from 'vite';
|
|
17
|
+
import { pnpPlugin } from '@gjsify/rolldown-plugin-pnp';
|
|
18
|
+
|
|
19
|
+
export default defineConfig({
|
|
20
|
+
plugins: [await pnpPlugin()],
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The plugin returns `null` when not running under Yarn PnP, so spreading it is safe in any environment:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { rolldown } from 'rolldown';
|
|
28
|
+
import { pnpPlugin } from '@gjsify/rolldown-plugin-pnp';
|
|
29
|
+
|
|
30
|
+
const build = await rolldown({
|
|
31
|
+
input: 'src/index.ts',
|
|
32
|
+
plugins: [await pnpPlugin({ issuerUrl: import.meta.url })],
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
MIT
|