@promoboxx/react-scripts-vite 0.1.25 → 0.1.27

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.
@@ -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,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Replace env variables in index.html
5
+ * @see https://github.com/vitejs/vite/issues/3105#issuecomment-939703781
6
+ * @see https://vitejs.dev/guide/api-plugin.html#transformindexhtml
7
+ */
8
+ function replaceEnvInHtml() {
9
+ var config = undefined;
10
+ var plugin = {
11
+ name: 'replace-env-in-html',
12
+ configResolved: function (resolvedConfig) {
13
+ config = resolvedConfig;
14
+ },
15
+ transformIndexHtml: {
16
+ enforce: 'pre',
17
+ transform: function (html) {
18
+ return html.replace(/%(.*?)%/g, function (match, envVarName) { var _a, _b; return (_b = (_a = config === null || config === void 0 ? void 0 : config.env) === null || _a === void 0 ? void 0 : _a[envVarName]) !== null && _b !== void 0 ? _b : match; });
19
+ },
20
+ },
21
+ };
22
+ return plugin;
23
+ }
24
+ exports.default = replaceEnvInHtml;
25
+ //# sourceMappingURL=replaceEnvInHtml.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promoboxx/react-scripts-vite",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [],
@@ -15,20 +15,20 @@
15
15
  "license": "ISC",
16
16
  "devDependencies": {
17
17
  "@promoboxx/eslint-config": "^2.5.0",
18
- "prettier": "^2.5.1",
19
- "typescript": "^4.5.5"
18
+ "prettier": "^2.7.1",
19
+ "typescript": "^4.8.3"
20
20
  },
21
21
  "dependencies": {
22
- "@vitejs/plugin-react": "^1.2.0",
22
+ "@vitejs/plugin-react": "^2.1.0",
23
23
  "eslint": "^7.32.0",
24
- "jsdom": "^19.0.0",
25
- "vite": "^2.8.4",
26
- "vite-plugin-checker": "^0.4.2",
24
+ "jsdom": "^20.0.0",
25
+ "vite": "^3.1.0",
26
+ "vite-plugin-checker": "^0.4.9",
27
27
  "vite-plugin-env-compatible": "^1.1.1",
28
- "vite-plugin-pwa": "^0.11.13",
29
- "vite-plugin-svgr": "^1.0.1",
30
- "vite-tsconfig-paths": "^3.4.1",
31
- "vitest": "^0.5.5"
28
+ "vite-plugin-pwa": "^0.12.7",
29
+ "vite-plugin-svgr": "^2.2.1",
30
+ "vite-tsconfig-paths": "^3.5.0",
31
+ "vitest": "^0.23.2"
32
32
  },
33
33
  "files": [
34
34
  "dist/cli.d.ts",
@@ -36,6 +36,8 @@
36
36
  "dist/cli.js",
37
37
  "dist/index.d.ts",
38
38
  "dist/index.js",
39
+ "dist/replaceEnvInHtml.d.ts",
40
+ "dist/replaceEnvInHtml.js",
39
41
  "dist/viteConfig.d.ts",
40
42
  "dist/viteConfig.js"
41
43
  ]