@promoboxx/react-scripts-vite 0.1.14 → 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 +26 -22
- package/package.json +1 -1
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
|
-
|
|
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
|