@promoboxx/react-scripts-vite 0.1.31-esm.4 → 0.1.31-esm.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 → cjs/cli.d.ts} +0 -1
- package/dist/{cli.js → cjs/cli.js} +5 -5
- package/dist/cjs/client.d.d.ts +2 -0
- package/dist/cjs/client.d.js +1 -0
- package/dist/cjs/index.js +42 -0
- package/dist/cjs/replaceEnvInHtml.js +48 -0
- package/dist/cjs/viteConfig.js +112 -0
- package/dist/{cli.d.mts → esm/cli.d.mts} +0 -1
- package/dist/{cli.mjs → esm/cli.mjs} +1 -3
- package/dist/esm/client.d.d.mts +2 -0
- package/dist/esm/client.d.mjs +0 -0
- package/dist/esm/index.mjs +6 -0
- package/dist/{chunk-7C4MM7WS.mjs → esm/replaceEnvInHtml.mjs} +1 -2
- package/dist/{chunk-OVJO5LTY.mjs → esm/viteConfig.mjs} +5 -9
- package/package.json +11 -11
- package/dist/chunk-D3BNAB2W.js +0 -25
- package/dist/chunk-WXKVM37Z.js +0 -81
- package/dist/index.js +0 -9
- package/dist/index.mjs +0 -9
- package/dist/replaceEnvInHtml.js +0 -8
- package/dist/replaceEnvInHtml.mjs +0 -6
- package/dist/viteConfig.js +0 -9
- package/dist/viteConfig.mjs +0 -9
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/{replaceEnvInHtml.d.ts → cjs/replaceEnvInHtml.d.ts} +0 -0
- /package/dist/{viteConfig.d.ts → cjs/viteConfig.d.ts} +0 -0
- /package/dist/{index.d.mts → esm/index.d.mts} +0 -0
- /package/dist/{replaceEnvInHtml.d.mts → esm/replaceEnvInHtml.d.mts} +0 -0
- /package/dist/{viteConfig.d.mts → esm/viteConfig.d.mts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
3
|
// src/cli.ts
|
|
4
|
-
var
|
|
4
|
+
var import_child_process = require("child_process/index");
|
|
5
5
|
function main(command2, args2) {
|
|
6
6
|
switch (command2) {
|
|
7
7
|
case "start":
|
|
@@ -22,7 +22,7 @@ function main(command2, args2) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
function spawnAndExit(command2, args2 = [], env) {
|
|
25
|
-
const child =
|
|
25
|
+
const child = (0, import_child_process.spawn)(command2, args2, {
|
|
26
26
|
stdio: "inherit",
|
|
27
27
|
env: {
|
|
28
28
|
...process.env,
|
|
@@ -31,7 +31,7 @@ function spawnAndExit(command2, args2 = [], env) {
|
|
|
31
31
|
// shell: true,
|
|
32
32
|
});
|
|
33
33
|
child.on("exit", (code) => {
|
|
34
|
-
process.exit(
|
|
34
|
+
process.exit(code != null ? code : void 0);
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
var [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
pluginOptions: () => import_viteConfig.pluginOptions,
|
|
34
|
+
viteConfig: () => import_viteConfig.default
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(src_exports);
|
|
37
|
+
var import_viteConfig = __toESM(require("./viteConfig"));
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
pluginOptions,
|
|
41
|
+
viteConfig
|
|
42
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/replaceEnvInHtml.ts
|
|
21
|
+
var replaceEnvInHtml_exports = {};
|
|
22
|
+
__export(replaceEnvInHtml_exports, {
|
|
23
|
+
default: () => replaceEnvInHtml_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(replaceEnvInHtml_exports);
|
|
26
|
+
function replaceEnvInHtml() {
|
|
27
|
+
let config = void 0;
|
|
28
|
+
const plugin = {
|
|
29
|
+
name: "replace-env-in-html",
|
|
30
|
+
configResolved(resolvedConfig) {
|
|
31
|
+
config = resolvedConfig;
|
|
32
|
+
},
|
|
33
|
+
transformIndexHtml: {
|
|
34
|
+
order: "pre",
|
|
35
|
+
handler(html) {
|
|
36
|
+
return html.replace(
|
|
37
|
+
/%(.*?)%/g,
|
|
38
|
+
(match, envVarName) => {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
return (_b = (_a = config == null ? void 0 : config.env) == null ? void 0 : _a[envVarName]) != null ? _b : match;
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return plugin;
|
|
47
|
+
}
|
|
48
|
+
var replaceEnvInHtml_default = replaceEnvInHtml;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/viteConfig.ts
|
|
31
|
+
var viteConfig_exports = {};
|
|
32
|
+
__export(viteConfig_exports, {
|
|
33
|
+
default: () => viteConfig_default,
|
|
34
|
+
pluginOptions: () => pluginOptions
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(viteConfig_exports);
|
|
37
|
+
var import_fs = __toESM(require("fs/index"));
|
|
38
|
+
var import_plugin_react = __toESM(require("@vitejs/plugin-react"));
|
|
39
|
+
var import_alias_hq = __toESM(require("alias-hq"));
|
|
40
|
+
var import_vite_plugin_checker = __toESM(require("vite-plugin-checker"));
|
|
41
|
+
var import_vite_plugin_environment = __toESM(require("vite-plugin-environment"));
|
|
42
|
+
var import_vite_plugin_pwa = require("vite-plugin-pwa");
|
|
43
|
+
var import_vite_plugin_svgr = __toESM(require("vite-plugin-svgr"));
|
|
44
|
+
var import_replaceEnvInHtml = __toESM(require("./replaceEnvInHtml"));
|
|
45
|
+
var pluginOptions = {
|
|
46
|
+
checker: {
|
|
47
|
+
eslint: process.env.DISABLE_ESLINT_PLUGIN === "true" ? void 0 : {
|
|
48
|
+
lintCommand: `eslint --max-warnings=${process.env.CI === "true" ? 0 : -1} "./src/**/*.{ts,tsx,js,jsx,mjs,cjs}"`
|
|
49
|
+
},
|
|
50
|
+
typescript: process.env.TSC_COMPILE_ON_ERROR !== "true",
|
|
51
|
+
enableBuild: true,
|
|
52
|
+
overlay: {
|
|
53
|
+
initialIsOpen: false
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
react: {
|
|
57
|
+
jsxRuntime: process.env.DISABLE_NEW_JSX_TRANSFORM === "true" ? "classic" : void 0
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
var viteConfig = () => {
|
|
61
|
+
const ENV_PREFIX = pluginOptions.envPrefix || "REACT_APP_";
|
|
62
|
+
if (pluginOptions.envCompatible !== false) {
|
|
63
|
+
pluginOptions.envCompatible = {
|
|
64
|
+
prefix: ENV_PREFIX,
|
|
65
|
+
...pluginOptions.envCompatible
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
base: process.env.PUBLIC_URL,
|
|
70
|
+
envPrefix: ENV_PREFIX,
|
|
71
|
+
build: {
|
|
72
|
+
outDir: process.env.BUILD_PATH || "build",
|
|
73
|
+
sourcemap: process.env.GENERATE_SOURCEMAP !== "false",
|
|
74
|
+
assetsInlineLimit: process.env.IMAGE_INLINE_SIZE_LIMIT ? Number(process.env.IMAGE_INLINE_SIZE_LIMIT) : 1e4
|
|
75
|
+
},
|
|
76
|
+
plugins: [
|
|
77
|
+
// Replace %ENVIRONMENT_VARIABLES% in .html files
|
|
78
|
+
(0, import_replaceEnvInHtml.default)(),
|
|
79
|
+
// React specific.
|
|
80
|
+
pluginOptions.react === false ? null : (0, import_plugin_react.default)(pluginOptions.react),
|
|
81
|
+
pluginOptions.svgr === false ? null : (0, import_vite_plugin_svgr.default)(pluginOptions.svgr),
|
|
82
|
+
// import.meta.env -> process.env
|
|
83
|
+
pluginOptions.envCompatible === false ? null : (0, import_vite_plugin_environment.default)("all", pluginOptions.envCompatible),
|
|
84
|
+
// PWA.
|
|
85
|
+
pluginOptions.pwa === false ? null : (0, import_vite_plugin_pwa.VitePWA)(pluginOptions.pwa),
|
|
86
|
+
// Check for issues.
|
|
87
|
+
process.env.NODE_ENV === "test" || pluginOptions.checker === false ? null : (0, import_vite_plugin_checker.default)(pluginOptions.checker)
|
|
88
|
+
],
|
|
89
|
+
server: {
|
|
90
|
+
open: true,
|
|
91
|
+
host: process.env.HOST || "0.0.0.0",
|
|
92
|
+
port: process.env.PORT ? Number(process.env.PORT) : 3e3,
|
|
93
|
+
https: process.env.HTTPS === "true" ? {
|
|
94
|
+
cert: process.env.SSL_CRT_FILE ? import_fs.default.readFileSync(process.env.SSL_CRT_FILE) : void 0,
|
|
95
|
+
key: process.env.SSL_KEY_FILE ? import_fs.default.readFileSync(process.env.SSL_KEY_FILE) : void 0
|
|
96
|
+
} : void 0
|
|
97
|
+
},
|
|
98
|
+
test: {
|
|
99
|
+
globals: true,
|
|
100
|
+
environment: "jsdom",
|
|
101
|
+
setupFiles: "./src/test/setup.ts"
|
|
102
|
+
},
|
|
103
|
+
resolve: {
|
|
104
|
+
alias: pluginOptions.aliasHq === false ? {} : import_alias_hq.default.get("rollup")
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
var viteConfig_default = viteConfig;
|
|
109
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
+
0 && (module.exports = {
|
|
111
|
+
pluginOptions
|
|
112
|
+
});
|
|
File without changes
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
replaceEnvInHtml_default
|
|
3
|
-
} from "./chunk-7C4MM7WS.mjs";
|
|
4
|
-
|
|
5
1
|
// src/viteConfig.ts
|
|
6
|
-
import fs from "fs";
|
|
2
|
+
import fs from "fs/index.mjs";
|
|
7
3
|
import react from "@vitejs/plugin-react";
|
|
8
4
|
import aliasHq from "alias-hq";
|
|
9
5
|
import pluginChecker from "vite-plugin-checker";
|
|
10
6
|
import envCompatible from "vite-plugin-environment";
|
|
11
7
|
import { VitePWA } from "vite-plugin-pwa";
|
|
12
8
|
import svgr from "vite-plugin-svgr";
|
|
9
|
+
import replaceEnvInHtml from "./replaceEnvInHtml.mjs";
|
|
13
10
|
var pluginOptions = {
|
|
14
11
|
checker: {
|
|
15
12
|
eslint: process.env.DISABLE_ESLINT_PLUGIN === "true" ? void 0 : {
|
|
@@ -43,7 +40,7 @@ var viteConfig = () => {
|
|
|
43
40
|
},
|
|
44
41
|
plugins: [
|
|
45
42
|
// Replace %ENVIRONMENT_VARIABLES% in .html files
|
|
46
|
-
|
|
43
|
+
replaceEnvInHtml(),
|
|
47
44
|
// React specific.
|
|
48
45
|
pluginOptions.react === false ? null : react(pluginOptions.react),
|
|
49
46
|
pluginOptions.svgr === false ? null : svgr(pluginOptions.svgr),
|
|
@@ -74,8 +71,7 @@ var viteConfig = () => {
|
|
|
74
71
|
};
|
|
75
72
|
};
|
|
76
73
|
var viteConfig_default = viteConfig;
|
|
77
|
-
|
|
78
74
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
viteConfig_default as default,
|
|
76
|
+
pluginOptions
|
|
81
77
|
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promoboxx/react-scripts-vite",
|
|
3
|
-
"version": "0.1.31-esm.
|
|
3
|
+
"version": "0.1.31-esm.6",
|
|
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-esm": "./dist/cli.mjs",
|
|
13
|
-
"react-scripts-vite-esm": "./dist/cli.mjs",
|
|
14
|
-
"react-scripts": "./dist/cli.js",
|
|
15
|
-
"react-scripts-vite": "./dist/cli.js"
|
|
12
|
+
"react-scripts-esm": "./dist/esm/cli.mjs",
|
|
13
|
+
"react-scripts-vite-esm": "./dist/esm/cli.mjs",
|
|
14
|
+
"react-scripts": "./dist/cjs/cli.js",
|
|
15
|
+
"react-scripts-vite": "./dist/cjs/cli.js"
|
|
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/esm/index.mjs",
|
|
29
|
+
"require": "./dist/cjs/index.js"
|
|
30
30
|
},
|
|
31
31
|
"./*": {
|
|
32
|
-
"import": "./dist/*.mjs",
|
|
33
|
-
"require": "./dist/*.js"
|
|
32
|
+
"import": "./dist/esm/*.mjs",
|
|
33
|
+
"require": "./dist/cjs/*.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
package/dist/chunk-D3BNAB2W.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/replaceEnvInHtml.ts
|
|
2
|
-
function replaceEnvInHtml() {
|
|
3
|
-
let config = void 0;
|
|
4
|
-
const plugin = {
|
|
5
|
-
name: "replace-env-in-html",
|
|
6
|
-
configResolved(resolvedConfig) {
|
|
7
|
-
config = resolvedConfig;
|
|
8
|
-
},
|
|
9
|
-
transformIndexHtml: {
|
|
10
|
-
order: "pre",
|
|
11
|
-
handler(html) {
|
|
12
|
-
return html.replace(
|
|
13
|
-
/%(.*?)%/g,
|
|
14
|
-
(match, envVarName) => _nullishCoalesce(_optionalChain([config, 'optionalAccess', _ => _.env, 'optionalAccess', _2 => _2[envVarName]]), () => ( match))
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
return plugin;
|
|
20
|
-
}
|
|
21
|
-
var replaceEnvInHtml_default = replaceEnvInHtml;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
exports.replaceEnvInHtml_default = replaceEnvInHtml_default;
|
package/dist/chunk-WXKVM37Z.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
-
|
|
3
|
-
var _chunkD3BNAB2Wjs = require('./chunk-D3BNAB2W.js');
|
|
4
|
-
|
|
5
|
-
// src/viteConfig.ts
|
|
6
|
-
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
7
|
-
var _pluginreact = require('@vitejs/plugin-react'); var _pluginreact2 = _interopRequireDefault(_pluginreact);
|
|
8
|
-
var _aliashq = require('alias-hq'); var _aliashq2 = _interopRequireDefault(_aliashq);
|
|
9
|
-
var _vitepluginchecker = require('vite-plugin-checker'); var _vitepluginchecker2 = _interopRequireDefault(_vitepluginchecker);
|
|
10
|
-
var _vitepluginenvironment = require('vite-plugin-environment'); var _vitepluginenvironment2 = _interopRequireDefault(_vitepluginenvironment);
|
|
11
|
-
var _vitepluginpwa = require('vite-plugin-pwa');
|
|
12
|
-
var _vitepluginsvgr = require('vite-plugin-svgr'); var _vitepluginsvgr2 = _interopRequireDefault(_vitepluginsvgr);
|
|
13
|
-
var pluginOptions = {
|
|
14
|
-
checker: {
|
|
15
|
-
eslint: process.env.DISABLE_ESLINT_PLUGIN === "true" ? void 0 : {
|
|
16
|
-
lintCommand: `eslint --max-warnings=${process.env.CI === "true" ? 0 : -1} "./src/**/*.{ts,tsx,js,jsx,mjs,cjs}"`
|
|
17
|
-
},
|
|
18
|
-
typescript: process.env.TSC_COMPILE_ON_ERROR !== "true",
|
|
19
|
-
enableBuild: true,
|
|
20
|
-
overlay: {
|
|
21
|
-
initialIsOpen: false
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
react: {
|
|
25
|
-
jsxRuntime: process.env.DISABLE_NEW_JSX_TRANSFORM === "true" ? "classic" : void 0
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
var viteConfig = () => {
|
|
29
|
-
const ENV_PREFIX = pluginOptions.envPrefix || "REACT_APP_";
|
|
30
|
-
if (pluginOptions.envCompatible !== false) {
|
|
31
|
-
pluginOptions.envCompatible = {
|
|
32
|
-
prefix: ENV_PREFIX,
|
|
33
|
-
...pluginOptions.envCompatible
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
base: process.env.PUBLIC_URL,
|
|
38
|
-
envPrefix: ENV_PREFIX,
|
|
39
|
-
build: {
|
|
40
|
-
outDir: process.env.BUILD_PATH || "build",
|
|
41
|
-
sourcemap: process.env.GENERATE_SOURCEMAP !== "false",
|
|
42
|
-
assetsInlineLimit: process.env.IMAGE_INLINE_SIZE_LIMIT ? Number(process.env.IMAGE_INLINE_SIZE_LIMIT) : 1e4
|
|
43
|
-
},
|
|
44
|
-
plugins: [
|
|
45
|
-
// Replace %ENVIRONMENT_VARIABLES% in .html files
|
|
46
|
-
_chunkD3BNAB2Wjs.replaceEnvInHtml_default.call(void 0, ),
|
|
47
|
-
// React specific.
|
|
48
|
-
pluginOptions.react === false ? null : _pluginreact2.default.call(void 0, pluginOptions.react),
|
|
49
|
-
pluginOptions.svgr === false ? null : _vitepluginsvgr2.default.call(void 0, pluginOptions.svgr),
|
|
50
|
-
// import.meta.env -> process.env
|
|
51
|
-
pluginOptions.envCompatible === false ? null : _vitepluginenvironment2.default.call(void 0, "all", pluginOptions.envCompatible),
|
|
52
|
-
// PWA.
|
|
53
|
-
pluginOptions.pwa === false ? null : _vitepluginpwa.VitePWA.call(void 0, pluginOptions.pwa),
|
|
54
|
-
// Check for issues.
|
|
55
|
-
process.env.NODE_ENV === "test" || pluginOptions.checker === false ? null : _vitepluginchecker2.default.call(void 0, pluginOptions.checker)
|
|
56
|
-
],
|
|
57
|
-
server: {
|
|
58
|
-
open: true,
|
|
59
|
-
host: process.env.HOST || "0.0.0.0",
|
|
60
|
-
port: process.env.PORT ? Number(process.env.PORT) : 3e3,
|
|
61
|
-
https: process.env.HTTPS === "true" ? {
|
|
62
|
-
cert: process.env.SSL_CRT_FILE ? _fs2.default.readFileSync(process.env.SSL_CRT_FILE) : void 0,
|
|
63
|
-
key: process.env.SSL_KEY_FILE ? _fs2.default.readFileSync(process.env.SSL_KEY_FILE) : void 0
|
|
64
|
-
} : void 0
|
|
65
|
-
},
|
|
66
|
-
test: {
|
|
67
|
-
globals: true,
|
|
68
|
-
environment: "jsdom",
|
|
69
|
-
setupFiles: "./src/test/setup.ts"
|
|
70
|
-
},
|
|
71
|
-
resolve: {
|
|
72
|
-
alias: pluginOptions.aliasHq === false ? {} : _aliashq2.default.get("rollup")
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
var viteConfig_default = viteConfig;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
exports.pluginOptions = pluginOptions; exports.viteConfig_default = viteConfig_default;
|
package/dist/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkWXKVM37Zjs = require('./chunk-WXKVM37Z.js');
|
|
5
|
-
require('./chunk-D3BNAB2W.js');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.pluginOptions = _chunkWXKVM37Zjs.pluginOptions; exports.viteConfig = _chunkWXKVM37Zjs.viteConfig_default;
|
package/dist/index.mjs
DELETED
package/dist/replaceEnvInHtml.js
DELETED
package/dist/viteConfig.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkWXKVM37Zjs = require('./chunk-WXKVM37Z.js');
|
|
5
|
-
require('./chunk-D3BNAB2W.js');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.default = _chunkWXKVM37Zjs.viteConfig_default; exports.pluginOptions = _chunkWXKVM37Zjs.pluginOptions;
|
package/dist/viteConfig.mjs
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|