@promoboxx/react-scripts-vite 0.1.12 → 0.1.15

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.js CHANGED
@@ -11,31 +11,35 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  var child_process_1 = require("child_process");
14
+ function main(command, args) {
15
+ switch (command) {
16
+ case 'start':
17
+ spawnAndExit('./node_modules/.bin/vite', args);
18
+ break;
19
+ case 'test':
20
+ spawnAndExit('./node_modules/.bin/vitest', args);
21
+ break;
22
+ case 'build':
23
+ spawnAndExit('./node_modules/.bin/vite', __spreadArray(['build'], args, true));
24
+ break;
25
+ default:
26
+ throw new Error("Unknown command: ".concat(command));
27
+ }
28
+ }
29
+ function spawnAndExit(command, args) {
30
+ if (args === void 0) { args = []; }
31
+ var child = (0, child_process_1.spawn)(command, args, {
32
+ stdio: 'inherit',
33
+ // shell: true,
34
+ });
35
+ child.on('exit', function (code) {
36
+ process.exit(code !== null && code !== void 0 ? code : undefined);
37
+ });
38
+ }
14
39
  var _a = process.argv,
15
40
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
16
41
  _interpreter = _a[0],
17
42
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
18
43
  _thisFile = _a[1], command = _a[2], args = _a.slice(3);
19
- switch (command) {
20
- case 'start':
21
- (0, child_process_1.spawn)('./node_modules/.bin/vite', args, {
22
- stdio: 'inherit',
23
- // shell: true,
24
- });
25
- break;
26
- case 'test':
27
- (0, child_process_1.spawn)('./node_modules/.bin/vitest', args, {
28
- stdio: 'inherit',
29
- // shell: true,
30
- });
31
- break;
32
- case 'build':
33
- (0, child_process_1.spawn)('./node_modules/.bin/vite', __spreadArray(['build'], args, true), {
34
- stdio: 'inherit',
35
- // shell: true,
36
- });
37
- break;
38
- default:
39
- throw new Error("Unknown command: ".concat(command));
40
- }
44
+ main(command, args);
41
45
  //# sourceMappingURL=cli.js.map
package/dist/index.d.ts CHANGED
@@ -0,0 +1 @@
1
+ export { default as viteConfig } from './viteConfig';
package/dist/index.js CHANGED
@@ -1,2 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.viteConfig = void 0;
7
+ var viteConfig_1 = require("./viteConfig");
8
+ Object.defineProperty(exports, "viteConfig", { enumerable: true, get: function () { return __importDefault(viteConfig_1).default; } });
2
9
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,2 @@
1
- import { UserConfig } from 'vite';
2
- declare const viteConfig: UserConfig;
3
- export default viteConfig;
1
+ declare const _default: import("vitest/dist/config").UserConfig;
2
+ export default _default;
@@ -8,29 +8,31 @@ var vite_plugin_checker_1 = __importDefault(require("vite-plugin-checker"));
8
8
  var vite_plugin_env_compatible_1 = __importDefault(require("vite-plugin-env-compatible"));
9
9
  var vite_plugin_svgr_1 = __importDefault(require("vite-plugin-svgr"));
10
10
  var vite_tsconfig_paths_1 = __importDefault(require("vite-tsconfig-paths"));
11
- var viteConfig = {
11
+ var config_1 = require("vitest/config");
12
+ exports.default = (0, config_1.defineConfig)({
12
13
  build: {
13
- outDir: 'build',
14
+ outDir: 'dist',
14
15
  sourcemap: true,
15
16
  },
16
17
  plugins: [
17
18
  // React specific.
19
+ // process.env.NODE_ENV !== 'test' && reactRefresh(),
18
20
  (0, plugin_react_1.default)(),
19
21
  (0, vite_plugin_svgr_1.default)(),
22
+ // reactJsx(),
20
23
  // import.meta.env -> process.env
21
24
  (0, vite_plugin_env_compatible_1.default)(),
22
25
  // Support TypeScript paths.
23
26
  (0, vite_tsconfig_paths_1.default)(),
24
27
  // Check for issues.
25
- // TODO
26
- // https://github.com/fi3ework/vite-plugin-checker/issues/68
27
- (0, vite_plugin_checker_1.default)({
28
- eslint: {
29
- lintCommand: "eslint --max-warnings=".concat(process.env.CI === 'true' ? 0 : -1, " \"./src/**/*.{ts,tsx,js,jsx,mjs}\""),
30
- },
31
- typescript: true,
32
- enableBuild: true,
33
- }),
28
+ process.env.NODE_ENV !== 'test' &&
29
+ (0, vite_plugin_checker_1.default)({
30
+ eslint: {
31
+ lintCommand: "eslint --max-warnings=".concat(process.env.CI === 'true' ? 0 : -1, " \"./src/**/*.{ts,tsx,js,jsx,mjs,cjs}\""),
32
+ },
33
+ typescript: true,
34
+ enableBuild: true,
35
+ }),
34
36
  ],
35
37
  resolve: {
36
38
  alias: {
@@ -39,6 +41,60 @@ var viteConfig = {
39
41
  '@material-ui/icons': '@material-ui/icons/esm',
40
42
  },
41
43
  },
42
- };
43
- exports.default = viteConfig;
44
+ test: {
45
+ globals: true,
46
+ environment: 'jsdom',
47
+ setupFiles: './src/test/setup.ts',
48
+ },
49
+ });
50
+ //
51
+ //
52
+ //
53
+ //
54
+ //
55
+ //
56
+ //
57
+ //
58
+ //
59
+ // import react from '@vitejs/plugin-react'
60
+ // import { UserConfig } from 'vite'
61
+ // import pluginChecker from 'vite-plugin-checker'
62
+ // import envCompatible from 'vite-plugin-env-compatible'
63
+ // import svgr from 'vite-plugin-svgr'
64
+ // import tsconfigPaths from 'vite-tsconfig-paths'
65
+ // const viteConfig: UserConfig = {
66
+ // build: {
67
+ // outDir: 'build',
68
+ // sourcemap: true,
69
+ // },
70
+ // plugins: [
71
+ // // React specific.
72
+ // react(),
73
+ // svgr(),
74
+ // // import.meta.env -> process.env
75
+ // envCompatible(),
76
+ // // Support TypeScript paths.
77
+ // tsconfigPaths(),
78
+ // // Check for issues.
79
+ // // TODO
80
+ // // https://github.com/fi3ework/vite-plugin-checker/issues/68
81
+ // pluginChecker({
82
+ // eslint: {
83
+ // lintCommand: `eslint --max-warnings=${
84
+ // process.env.CI === 'true' ? 0 : -1
85
+ // } "./src/**/*.{ts,tsx,js,jsx,mjs}"`,
86
+ // },
87
+ // typescript: true,
88
+ // enableBuild: true,
89
+ // }),
90
+ // ],
91
+ // resolve: {
92
+ // alias: {
93
+ // // This fixes weird styling issues with material-ui.
94
+ // '@material-ui/core': '@material-ui/core/esm',
95
+ // '@material-ui/icons': '@material-ui/icons/esm',
96
+ // },
97
+ // },
98
+ // }
99
+ // export default viteConfig
44
100
  //# sourceMappingURL=viteConfig.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promoboxx/react-scripts-vite",
3
- "version": "0.1.12",
3
+ "version": "0.1.15",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [],