Initial
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'path';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
|
||||
if (fs.existsSync('dist/index.html')) {
|
||||
if (fs.existsSync(path.join('dist', 'index.html'))) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const result = spawnSync(process.execPath, ['node_modules/vite/bin/vite.js', 'build'], { stdio: 'inherit' });
|
||||
const result = spawnSync(process.execPath, [path.join('node_modules', 'vite', 'bin', 'vite.js'), 'build'], { stdio: 'inherit' });
|
||||
|
||||
process.exit(result.status ?? 1);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { spawn } from 'node:child_process';
|
||||
import path from 'path';
|
||||
|
||||
const mode = process.argv[2] || 'development';
|
||||
const watch = process.argv.includes('--watch');
|
||||
const args = watch
|
||||
? ['node_modules/nodemon/bin/nodemon.js', 'server/index.js']
|
||||
: ['server/index.js'];
|
||||
? [path.join('node_modules', 'nodemon', 'bin', 'nodemon.js'), path.join('server', 'index.js')]
|
||||
: [path.join('server', 'index.js')];
|
||||
|
||||
const child = spawn(process.execPath, args, {
|
||||
stdio: 'inherit',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { spawn } from 'node:child_process';
|
||||
import path from 'path';
|
||||
|
||||
const child = spawn(process.execPath, ['node_modules/vite/bin/vite.js', 'preview', '--host', '0.0.0.0', '--port', '3000', '--strictPort'], {
|
||||
const child = spawn(process.execPath, [path.join('node_modules', 'vite', 'bin', 'vite.js'), 'preview', '--host', '0.0.0.0', '--port', '3000', '--strictPort'], {
|
||||
stdio: 'inherit',
|
||||
env: {
|
||||
...process.env,
|
||||
|
||||
Reference in New Issue
Block a user