Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix npm run watchreact initial build bug #233

Merged
merged 4 commits into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/vs/workbench/contrib/void/browser/react/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down