@gjsify/vite-plugin-gjsify 0.4.43 → 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 +48 -0
- package/package.json +6 -6
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# @gjsify/vite-plugin-gjsify
|
|
2
|
+
|
|
3
|
+
Vite plugin presets that mirror `gjsify build --app browser` and `--app nativescript` under Vite's dev server and HMR. Ensures a dual-target gjsify app develops under Vite with the same transforms (gi:// aliasing, Blueprint compilation, platform resolution, Node polyfill aliases) as its production CLI build.
|
|
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/vite-plugin-gjsify
|
|
11
|
+
|
|
12
|
+
# npm or yarn also work (e.g. adding it to an existing project):
|
|
13
|
+
npm install @gjsify/vite-plugin-gjsify
|
|
14
|
+
yarn add @gjsify/vite-plugin-gjsify
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### Browser target
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
// vite.config.ts
|
|
23
|
+
import { defineConfig } from 'vite';
|
|
24
|
+
import { gjsifyBrowser } from '@gjsify/vite-plugin-gjsify';
|
|
25
|
+
|
|
26
|
+
export default defineConfig({
|
|
27
|
+
plugins: [...gjsifyBrowser({ reflection: false })],
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### NativeScript target
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// vite.config.ts
|
|
35
|
+
import { defineConfig } from 'vite';
|
|
36
|
+
import nativescript from '@nativescript/vite';
|
|
37
|
+
import { gjsifyNativescript } from '@gjsify/vite-plugin-gjsify';
|
|
38
|
+
|
|
39
|
+
export default defineConfig({
|
|
40
|
+
plugins: [nativescript(), ...gjsifyNativescript()],
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Both presets resolve `@girs/*` / `gi://` imports to an empty module (those are GJS-only specifiers that leak transitively) and apply the gjsify alias layer for Node built-ins and polyfills.
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/vite-plugin-gjsify",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.44",
|
|
4
4
|
"description": "Vite plugin presets mirroring `gjsify build --app browser` / `--app nativescript` — dev (Vite/HMR) parity with the gjsify CLI targets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
],
|
|
40
40
|
"license": "MIT",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@gjsify/empty": "^0.4.
|
|
43
|
-
"@gjsify/resolve-npm": "^0.4.
|
|
44
|
-
"@gjsify/rolldown-plugin-deepkit": "^0.4.
|
|
45
|
-
"@gjsify/rolldown-plugin-gjsify": "^0.4.
|
|
46
|
-
"@gjsify/vite-plugin-blueprint": "^0.4.
|
|
42
|
+
"@gjsify/empty": "^0.4.44",
|
|
43
|
+
"@gjsify/resolve-npm": "^0.4.44",
|
|
44
|
+
"@gjsify/rolldown-plugin-deepkit": "^0.4.44",
|
|
45
|
+
"@gjsify/rolldown-plugin-gjsify": "^0.4.44",
|
|
46
|
+
"@gjsify/vite-plugin-blueprint": "^0.4.44"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"vite": "^8.0.14"
|