@promoboxx/react-scripts-vite 0.1.22 → 0.1.23

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/README.md CHANGED
@@ -48,7 +48,7 @@ Vite expects your `index.html` to live at the root directory, not in `public/`
48
48
  mv public/index.html ./
49
49
  ```
50
50
 
51
- Remove any references to `%PUBLIC_URL%`. Passing `--base /some/sub/dir/` to `build` will get you the same result.
51
+ Remove any references to `%PUBLIC_URL%`, vite correctly sets the base path for you.
52
52
 
53
53
  ### Sass
54
54
 
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ var fs_1 = __importDefault(require("fs"));
6
7
  var plugin_react_1 = __importDefault(require("@vitejs/plugin-react"));
7
8
  var vite_plugin_checker_1 = __importDefault(require("vite-plugin-checker"));
8
9
  var vite_plugin_env_compatible_1 = __importDefault(require("vite-plugin-env-compatible"));
@@ -10,17 +11,30 @@ var vite_plugin_pwa_1 = require("vite-plugin-pwa");
10
11
  var vite_plugin_svgr_1 = __importDefault(require("vite-plugin-svgr"));
11
12
  var vite_tsconfig_paths_1 = __importDefault(require("vite-tsconfig-paths"));
12
13
  var config_1 = require("vitest/config");
14
+ var ENV_PREFIX = 'REACT_APP_';
13
15
  exports.default = (0, config_1.defineConfig)({
16
+ base: process.env.PUBLIC_URL,
17
+ envPrefix: ENV_PREFIX,
14
18
  build: {
15
- outDir: 'build',
16
- sourcemap: true,
19
+ outDir: process.env.BUILD_PATH || 'build',
20
+ sourcemap: process.env.GENERATE_SOURCEMAP !== 'false',
21
+ assetsInlineLimit: process.env.IMAGE_INLINE_SIZE_LIMIT
22
+ ? Number(process.env.IMAGE_INLINE_SIZE_LIMIT)
23
+ : 10000,
17
24
  },
18
25
  plugins: [
19
26
  // React specific.
20
- (0, plugin_react_1.default)(),
27
+ (0, plugin_react_1.default)({
28
+ fastRefresh: process.env.FAST_REFRESH !== 'false',
29
+ jsxRuntime: process.env.DISABLE_NEW_JSX_TRANSFORM === 'true'
30
+ ? 'classic'
31
+ : undefined,
32
+ }),
21
33
  (0, vite_plugin_svgr_1.default)(),
22
34
  // import.meta.env -> process.env
23
- (0, vite_plugin_env_compatible_1.default)(),
35
+ (0, vite_plugin_env_compatible_1.default)({
36
+ prefix: ENV_PREFIX,
37
+ }),
24
38
  // Support TypeScript paths.
25
39
  (0, vite_tsconfig_paths_1.default)(),
26
40
  // PWA.
@@ -28,16 +42,29 @@ exports.default = (0, config_1.defineConfig)({
28
42
  // Check for issues.
29
43
  process.env.NODE_ENV !== 'test' &&
30
44
  (0, vite_plugin_checker_1.default)({
31
- eslint: {
32
- lintCommand: "eslint --max-warnings=".concat(process.env.CI === 'true' ? 0 : -1, " \"./src/**/*.{ts,tsx,js,jsx,mjs,cjs}\""),
33
- },
34
- typescript: true,
45
+ eslint: process.env.DISABLE_ESLINT_PLUGIN === 'true'
46
+ ? undefined
47
+ : {
48
+ lintCommand: "eslint --max-warnings=".concat(process.env.CI === 'true' ? 0 : -1, " \"./src/**/*.{ts,tsx,js,jsx,mjs,cjs}\""),
49
+ },
50
+ typescript: process.env.TSC_COMPILE_ON_ERROR !== 'true',
35
51
  enableBuild: true,
36
52
  }),
37
53
  ],
38
54
  server: {
39
55
  open: true,
40
- host: '0.0.0.0',
56
+ host: process.env.HOST || '0.0.0.0',
57
+ port: process.env.PORT ? Number(process.env.PORT) : 3000,
58
+ https: process.env.HTTPS === 'true'
59
+ ? {
60
+ cert: process.env.SSL_CRT_FILE
61
+ ? fs_1.default.readFileSync(process.env.SSL_CRT_FILE)
62
+ : undefined,
63
+ key: process.env.SSL_KEY_FILE
64
+ ? fs_1.default.readFileSync(process.env.SSL_KEY_FILE)
65
+ : undefined,
66
+ }
67
+ : undefined,
41
68
  },
42
69
  test: {
43
70
  globals: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promoboxx/react-scripts-vite",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [],