mirror of
https://github.com/voideditor/void
synced 2026-05-23 17:38:23 +00:00
Merge pull request #233 from bjoaquinc/react-build-bug-fix
Fix npm run watchreact initial build bug
This commit is contained in:
commit
c1123f2cfd
1 changed files with 16 additions and 0 deletions
|
|
@ -80,6 +80,22 @@ const args = process.argv.slice(2);
|
|||
const isWatch = args.includes('--watch') || args.includes('-w');
|
||||
|
||||
if (isWatch) {
|
||||
// this just builds it if it doesn't exist instead of waiting for the watcher to trigger
|
||||
// Check if src2/ exists; if not, do an initial scope-tailwind build
|
||||
if (!fs.existsSync('src2')) {
|
||||
try {
|
||||
console.log('🔨 Running initial scope-tailwind build to create src2 folder...');
|
||||
execSync(
|
||||
'npx scope-tailwind ./src -o src2/ -s void-scope -c styles.css -p "void-"',
|
||||
{ stdio: 'inherit' }
|
||||
);
|
||||
console.log('✅ src2/ created successfully.');
|
||||
} catch (err) {
|
||||
console.error('❌ Error running initial scope-tailwind build:', err);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Watch mode
|
||||
const scopeTailwindWatcher = spawn('npx', [
|
||||
'nodemon',
|
||||
|
|
|
|||
Loading…
Reference in a new issue