@promoboxx/react-scripts-vite 0.1.21 → 0.1.22
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 +1 -0
- package/dist/client.d.ts +35 -0
- package/dist/viteConfig.js +3 -0
- package/package.json +2 -1
package/README.md
CHANGED
package/dist/client.d.ts
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
/// <reference types="vite-plugin-svgr/client" />
|
|
3
3
|
/// <reference types="vitest/globals" />
|
|
4
|
+
|
|
5
|
+
// https://github.com/antfu/vite-plugin-pwa/blob/951311fa811b8cee98ea5530522961f64645cd75/client.d.ts
|
|
6
|
+
declare module 'virtual:pwa-register' {
|
|
7
|
+
export type RegisterSWOptions = {
|
|
8
|
+
immediate?: boolean
|
|
9
|
+
onNeedRefresh?: () => void
|
|
10
|
+
onOfflineReady?: () => void
|
|
11
|
+
onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void
|
|
12
|
+
onRegisterError?: (error: any) => void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function registerSW(
|
|
16
|
+
options?: RegisterSWOptions,
|
|
17
|
+
): (reloadPage?: boolean) => Promise<void>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// https://github.com/antfu/vite-plugin-pwa/blob/951311fa811b8cee98ea5530522961f64645cd75/client.d.ts
|
|
21
|
+
declare module 'virtual:pwa-register/react' {
|
|
22
|
+
// @ts-ignore ignore when react is not installed
|
|
23
|
+
import { Dispatch, SetStateAction } from 'react'
|
|
24
|
+
|
|
25
|
+
export type RegisterSWOptions = {
|
|
26
|
+
immediate?: boolean
|
|
27
|
+
onNeedRefresh?: () => void
|
|
28
|
+
onOfflineReady?: () => void
|
|
29
|
+
onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void
|
|
30
|
+
onRegisterError?: (error: any) => void
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function useRegisterSW(options?: RegisterSWOptions): {
|
|
34
|
+
needRefresh: [boolean, Dispatch<SetStateAction<boolean>>]
|
|
35
|
+
offlineReady: [boolean, Dispatch<SetStateAction<boolean>>]
|
|
36
|
+
updateServiceWorker: (reloadPage?: boolean) => Promise<void>
|
|
37
|
+
}
|
|
38
|
+
}
|
package/dist/viteConfig.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
var plugin_react_1 = __importDefault(require("@vitejs/plugin-react"));
|
|
7
7
|
var vite_plugin_checker_1 = __importDefault(require("vite-plugin-checker"));
|
|
8
8
|
var vite_plugin_env_compatible_1 = __importDefault(require("vite-plugin-env-compatible"));
|
|
9
|
+
var vite_plugin_pwa_1 = require("vite-plugin-pwa");
|
|
9
10
|
var vite_plugin_svgr_1 = __importDefault(require("vite-plugin-svgr"));
|
|
10
11
|
var vite_tsconfig_paths_1 = __importDefault(require("vite-tsconfig-paths"));
|
|
11
12
|
var config_1 = require("vitest/config");
|
|
@@ -22,6 +23,8 @@ exports.default = (0, config_1.defineConfig)({
|
|
|
22
23
|
(0, vite_plugin_env_compatible_1.default)(),
|
|
23
24
|
// Support TypeScript paths.
|
|
24
25
|
(0, vite_tsconfig_paths_1.default)(),
|
|
26
|
+
// PWA.
|
|
27
|
+
(0, vite_plugin_pwa_1.VitePWA)(),
|
|
25
28
|
// Check for issues.
|
|
26
29
|
process.env.NODE_ENV !== 'test' &&
|
|
27
30
|
(0, vite_plugin_checker_1.default)({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promoboxx/react-scripts-vite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"keywords": [],
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"vite": "^2.8.4",
|
|
26
26
|
"vite-plugin-checker": "^0.4.2",
|
|
27
27
|
"vite-plugin-env-compatible": "^1.1.1",
|
|
28
|
+
"vite-plugin-pwa": "^0.11.13",
|
|
28
29
|
"vite-plugin-svgr": "^1.0.1",
|
|
29
30
|
"vite-tsconfig-paths": "^3.4.1",
|
|
30
31
|
"vitest": "^0.5.5"
|