@enhance-eng/sandbox 0.3.10 → 0.3.17-dev.7469ea2
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 +44 -0
- package/dist/assets/enhance-runtime.js +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +73 -91
- package/dist/index.js +1 -1
- package/dist/sw-enhance.js +1 -1
- package/dist/vite/index.d.ts +14 -0
- package/dist/vite/index.js +1 -0
- package/package.json +14 -12
- package/bin/enhance-sandbox.js +0 -2
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -121
- package/dist/manifest.json +0 -7
- package/dist/postinstall.js +0 -1
- package/enhance.config.sample.json +0 -4
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @enhance-eng/sandbox
|
|
2
|
+
|
|
3
|
+
Enhance sandbox library for adding preview functionality to your application.
|
|
4
|
+
|
|
5
|
+
**Supported frameworks:** React SPAs and statically generated sites. SSR is not supported.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @enhance-eng/sandbox
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Vite
|
|
14
|
+
|
|
15
|
+
Add the plugin to your Vite config:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
// vite.config.ts
|
|
19
|
+
import { enhance } from "@enhance-eng/sandbox/vite";
|
|
20
|
+
|
|
21
|
+
export default defineConfig({
|
|
22
|
+
plugins: [enhance()],
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
That's it. The plugin handles everything automatically.
|
|
27
|
+
|
|
28
|
+
## Other Build Tools
|
|
29
|
+
|
|
30
|
+
For non-Vite setups, use the CLI to copy the required assets to your public directory:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx enhance-sandbox prepare-sw --public-dir ./public
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Then initialize Enhance in your application entry point:
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { Enhance } from "@enhance-eng/sandbox";
|
|
40
|
+
|
|
41
|
+
Enhance.init();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Run the CLI as part of your build process to keep assets up to date.
|