@promoboxx/react-scripts-vite 0.1.30-rc.3 → 0.1.30-rc.5
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/cli.d.ts +2 -0
- package/dist/cli.js +1 -1
- package/dist/cli.mjs +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/replaceEnvInHtml.d.ts +8 -0
- package/dist/viteConfig.d.ts +19 -0
- package/dist/viteConfig.js +2 -1
- package/dist/viteConfig.mjs +2 -1
- package/package.json +4 -2
package/dist/cli.d.ts
ADDED
package/dist/cli.js
CHANGED
package/dist/cli.mjs
CHANGED
|
File without changes
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as viteConfig, pluginOptions } from './viteConfig';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type 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<any>;
|
|
8
|
+
export default replaceEnvInHtml;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import react from '@vitejs/plugin-react';
|
|
2
|
+
import { type UserConfigFn } from 'vite';
|
|
3
|
+
import pluginChecker from 'vite-plugin-checker';
|
|
4
|
+
import { VitePWA } from 'vite-plugin-pwa';
|
|
5
|
+
import svgr from 'vite-plugin-svgr';
|
|
6
|
+
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
7
|
+
declare const envCompatible: any;
|
|
8
|
+
interface ReactScriptsViteOptions {
|
|
9
|
+
react?: false | Parameters<typeof react>[0];
|
|
10
|
+
svgr?: false | Parameters<typeof svgr>[0];
|
|
11
|
+
envCompatible?: false | Parameters<typeof envCompatible>[0];
|
|
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/dist/viteConfig.js
CHANGED
|
@@ -13,6 +13,7 @@ var _vitePluginSvgr = _interopRequireDefault(require("vite-plugin-svgr"));
|
|
|
13
13
|
var _viteTsconfigPaths = _interopRequireDefault(require("vite-tsconfig-paths"));
|
|
14
14
|
var _replaceEnvInHtml = _interopRequireDefault(require("./replaceEnvInHtml"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
const envCompatible = _vitePluginEnvCompatible.default.default;
|
|
16
17
|
const pluginOptions = exports.pluginOptions = {
|
|
17
18
|
checker: {
|
|
18
19
|
eslint: process.env.DISABLE_ESLINT_PLUGIN === "true" ? void 0 : {
|
|
@@ -50,7 +51,7 @@ const viteConfig = () => {
|
|
|
50
51
|
// React specific.
|
|
51
52
|
pluginOptions.react === false ? null : (0, _pluginReact.default)(pluginOptions.react), pluginOptions.svgr === false ? null : (0, _vitePluginSvgr.default)(pluginOptions.svgr),
|
|
52
53
|
// import.meta.env -> process.env
|
|
53
|
-
pluginOptions.envCompatible === false ? null : (
|
|
54
|
+
pluginOptions.envCompatible === false ? null : envCompatible(pluginOptions.envCompatible),
|
|
54
55
|
// Support TypeScript paths.
|
|
55
56
|
pluginOptions.tsconfigPaths === false ? null : (0, _viteTsconfigPaths.default)(pluginOptions.tsconfigPaths),
|
|
56
57
|
// PWA.
|
package/dist/viteConfig.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import react from "@vitejs/plugin-react";
|
|
3
3
|
import pluginChecker from "vite-plugin-checker";
|
|
4
|
-
import
|
|
4
|
+
import envCompatibleDefault from "vite-plugin-env-compatible";
|
|
5
5
|
import { VitePWA } from "vite-plugin-pwa";
|
|
6
6
|
import svgr from "vite-plugin-svgr";
|
|
7
7
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
8
8
|
import replaceEnvInHtml from "./replaceEnvInHtml.mjs";
|
|
9
|
+
const envCompatible = envCompatibleDefault.default;
|
|
9
10
|
export const pluginOptions = {
|
|
10
11
|
checker: {
|
|
11
12
|
eslint: process.env.DISABLE_ESLINT_PLUGIN === "true" ? void 0 : {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promoboxx/react-scripts-vite",
|
|
3
|
-
"version": "0.1.30-rc.
|
|
3
|
+
"version": "0.1.30-rc.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
},
|
|
11
11
|
"bin": {
|
|
12
12
|
"react-scripts": "./dist/cli.js",
|
|
13
|
-
"react-scripts-vite": "./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"
|
|
14
16
|
},
|
|
15
17
|
"author": "",
|
|
16
18
|
"license": "ISC",
|