@promoboxx/react-scripts-vite 0.1.30-rc.8 → 0.1.30-rc.9
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/dist/cjs/client.d.ts +38 -0
- package/dist/client.d.ts +28 -28
- package/dist/esm/cli.d.ts +2 -0
- package/dist/esm/client.d.ts +38 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/replaceEnvInHtml.d.ts +8 -0
- package/dist/esm/viteConfig.d.ts +19 -0
- package/package.json +11 -11
- /package/dist/{cli.d.ts → cjs/cli.d.ts} +0 -0
- /package/dist/{cli.js → cjs/cli.js} +0 -0
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/{index.js → cjs/index.js} +0 -0
- /package/dist/{replaceEnvInHtml.d.ts → cjs/replaceEnvInHtml.d.ts} +0 -0
- /package/dist/{replaceEnvInHtml.js → cjs/replaceEnvInHtml.js} +0 -0
- /package/dist/{viteConfig.d.ts → cjs/viteConfig.d.ts} +0 -0
- /package/dist/{viteConfig.js → cjs/viteConfig.js} +0 -0
- /package/dist/{cli.mjs → esm/cli.mjs} +0 -0
- /package/dist/{index.mjs → esm/index.mjs} +0 -0
- /package/dist/{replaceEnvInHtml.mjs → esm/replaceEnvInHtml.mjs} +0 -0
- /package/dist/{viteConfig.mjs → esm/viteConfig.mjs} +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
/// <reference types="vite-plugin-svgr/client" />
|
|
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/client.d.ts
CHANGED
|
@@ -3,36 +3,36 @@
|
|
|
3
3
|
/// <reference types="vitest/globals" />
|
|
4
4
|
|
|
5
5
|
// https://github.com/antfu/vite-plugin-pwa/blob/951311fa811b8cee98ea5530522961f64645cd75/client.d.ts
|
|
6
|
-
declare module 'virtual:pwa-register' {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
15
|
+
// export function registerSW(
|
|
16
|
+
// options?: RegisterSWOptions,
|
|
17
|
+
// ): (reloadPage?: boolean) => Promise<void>
|
|
18
|
+
// }
|
|
19
19
|
|
|
20
20
|
// https://github.com/antfu/vite-plugin-pwa/blob/951311fa811b8cee98ea5530522961f64645cd75/client.d.ts
|
|
21
|
-
declare module 'virtual:pwa-register/react' {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
// declare module 'virtual:pwa-register/react' {
|
|
22
|
+
// // @ts-ignore ignore when react is not installed
|
|
23
|
+
// import { Dispatch, SetStateAction } from 'react'
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
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
|
+
// }
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
/// <reference types="vite-plugin-svgr/client" />
|
|
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
|
+
// }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as viteConfig, pluginOptions } from './viteConfig';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Replace env variables in index.html
|
|
4
|
+
* @see https://github.com/vitejs/vite/issues/3105#issuecomment-939703781
|
|
5
|
+
* @see https://vitejs.dev/guide/api-plugin.html#transformindexhtml
|
|
6
|
+
*/
|
|
7
|
+
declare function replaceEnvInHtml(): Plugin;
|
|
8
|
+
export default replaceEnvInHtml;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import react from '@vitejs/plugin-react';
|
|
2
|
+
import { UserConfigFn } from 'vite';
|
|
3
|
+
import pluginChecker from 'vite-plugin-checker';
|
|
4
|
+
import envCompatible from 'vite-plugin-environment';
|
|
5
|
+
import { VitePWA } from 'vite-plugin-pwa';
|
|
6
|
+
import svgr from 'vite-plugin-svgr';
|
|
7
|
+
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
8
|
+
interface ReactScriptsViteOptions {
|
|
9
|
+
react?: false | Parameters<typeof react>[0];
|
|
10
|
+
svgr?: false | Parameters<typeof svgr>[0];
|
|
11
|
+
envCompatible?: false | Parameters<typeof envCompatible>[1];
|
|
12
|
+
tsconfigPaths?: false | Parameters<typeof tsconfigPaths>[0];
|
|
13
|
+
pwa?: false | Parameters<typeof VitePWA>[0];
|
|
14
|
+
checker: false | Parameters<typeof pluginChecker>[0];
|
|
15
|
+
envPrefix?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const pluginOptions: ReactScriptsViteOptions;
|
|
18
|
+
declare const viteConfig: UserConfigFn;
|
|
19
|
+
export default viteConfig;
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promoboxx/react-scripts-vite",
|
|
3
|
-
"version": "0.1.30-rc.
|
|
3
|
+
"version": "0.1.30-rc.9",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"module": "./dist/index.mjs",
|
|
5
|
+
"main": "./dist/cjs/index.js",
|
|
6
|
+
"module": "./dist/esm/index.mjs",
|
|
7
7
|
"keywords": [],
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/promoboxx/react-scripts-vite"
|
|
10
10
|
},
|
|
11
11
|
"bin": {
|
|
12
|
-
"react-scripts": "./dist/cli.js",
|
|
13
|
-
"react-scripts-vite": "./dist/cli.js",
|
|
14
|
-
"react-scripts-esm": "./dist/cli.mjs",
|
|
15
|
-
"react-scripts-vite-esm": "./dist/cli.mjs"
|
|
12
|
+
"react-scripts": "./dist/cjs/cli.js",
|
|
13
|
+
"react-scripts-vite": "./dist/cjs/cli.js",
|
|
14
|
+
"react-scripts-esm": "./dist/esm/cli.mjs",
|
|
15
|
+
"react-scripts-vite-esm": "./dist/esm/cli.mjs"
|
|
16
16
|
},
|
|
17
17
|
"author": "",
|
|
18
18
|
"license": "ISC",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
|
-
"import": "./dist/index.mjs",
|
|
29
|
-
"require": "./dist/index.js"
|
|
28
|
+
"import": "./dist/cjs/index.mjs",
|
|
29
|
+
"require": "./dist/esm/index.js"
|
|
30
30
|
},
|
|
31
31
|
"./*": {
|
|
32
|
-
"import": "
|
|
33
|
-
"require": "
|
|
32
|
+
"import": "./*.mjs",
|
|
33
|
+
"require": "./*.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|