@promoboxx/react-scripts-vite 0.1.30-rc.4 → 0.1.30-rc.6

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 ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -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,20 @@
1
+ import react from '@vitejs/plugin-react';
2
+ import { type UserConfigFn } from 'vite';
3
+ import pluginChecker from 'vite-plugin-checker';
4
+ import * as envCompatibleDefault from 'vite-plugin-env-compatible';
5
+ import { VitePWA } from 'vite-plugin-pwa';
6
+ import svgr from 'vite-plugin-svgr';
7
+ import tsconfigPaths from 'vite-tsconfig-paths';
8
+ declare const envCompatible: typeof envCompatibleDefault.default;
9
+ interface ReactScriptsViteOptions {
10
+ react?: false | Parameters<typeof react>[0];
11
+ svgr?: false | Parameters<typeof svgr>[0];
12
+ envCompatible?: false | Parameters<typeof envCompatible>[0];
13
+ tsconfigPaths?: false | Parameters<typeof tsconfigPaths>[0];
14
+ pwa?: false | Parameters<typeof VitePWA>[0];
15
+ checker: false | Parameters<typeof pluginChecker>[0];
16
+ envPrefix?: string;
17
+ }
18
+ export declare const pluginOptions: ReactScriptsViteOptions;
19
+ declare const viteConfig: UserConfigFn;
20
+ export default viteConfig;
@@ -7,12 +7,15 @@ exports.pluginOptions = exports.default = void 0;
7
7
  var _fs = _interopRequireDefault(require("fs"));
8
8
  var _pluginReact = _interopRequireDefault(require("@vitejs/plugin-react"));
9
9
  var _vitePluginChecker = _interopRequireDefault(require("vite-plugin-checker"));
10
- var _vitePluginEnvCompatible = _interopRequireDefault(require("vite-plugin-env-compatible"));
10
+ var envCompatibleDefault = _interopRequireWildcard(require("vite-plugin-env-compatible"));
11
11
  var _vitePluginPwa = require("vite-plugin-pwa");
12
12
  var _vitePluginSvgr = _interopRequireDefault(require("vite-plugin-svgr"));
13
13
  var _viteTsconfigPaths = _interopRequireDefault(require("vite-tsconfig-paths"));
14
14
  var _replaceEnvInHtml = _interopRequireDefault(require("./replaceEnvInHtml"));
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+ const envCompatible = envCompatibleDefault.default;
16
19
  const pluginOptions = exports.pluginOptions = {
17
20
  checker: {
18
21
  eslint: process.env.DISABLE_ESLINT_PLUGIN === "true" ? void 0 : {
@@ -50,7 +53,7 @@ const viteConfig = () => {
50
53
  // React specific.
51
54
  pluginOptions.react === false ? null : (0, _pluginReact.default)(pluginOptions.react), pluginOptions.svgr === false ? null : (0, _vitePluginSvgr.default)(pluginOptions.svgr),
52
55
  // import.meta.env -> process.env
53
- pluginOptions.envCompatible === false ? null : (0, _vitePluginEnvCompatible.default)(pluginOptions.envCompatible),
56
+ pluginOptions.envCompatible === false ? null : envCompatible(pluginOptions.envCompatible),
54
57
  // Support TypeScript paths.
55
58
  pluginOptions.tsconfigPaths === false ? null : (0, _viteTsconfigPaths.default)(pluginOptions.tsconfigPaths),
56
59
  // PWA.
@@ -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 envCompatible from "vite-plugin-env-compatible";
4
+ import * as 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.4",
3
+ "version": "0.1.30-rc.6",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -23,10 +23,6 @@
23
23
  "unbuild": "^2.0.0"
24
24
  },
25
25
  "exports": {
26
- ".": {
27
- "import": "./dist/index.mjs",
28
- "require": "./dist/index.js"
29
- },
30
26
  "./*": {
31
27
  "import": "./dist/*.mjs",
32
28
  "require": "./dist/*.js"