Skip to content

feat: add dev script for previewing changes - #226

Open
TusharThakur04 wants to merge 3 commits into
webpack:mainfrom
TusharThakur04:feat/preview-changes
Open

feat: add dev script for previewing changes#226
TusharThakur04 wants to merge 3 commits into
webpack:mainfrom
TusharThakur04:feat/preview-changes

Conversation

@TusharThakur04

Copy link
Copy Markdown
Member

Summary
This PR adds a dev script for previewing changes in dev environment

What kind of change does this PR introduce?
feat

Did you add tests for your changes?
no

Does this PR introduce a breaking change?
no

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Use of AI

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-doc-kit Ready Ready Preview Jul 31, 2026 5:08pm

Request Review

Comment thread scripts/dev/index.mjs

const execFileAsync = promisify(execFile);

async function runDocKit(filePath = null) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running npx -p @node-core/doc-kit re-resolves the runner on every invoke, we should probably invoke node_modules/.bin/doc-kit

Comment thread scripts/dev/index.mjs Outdated
}

isBuilding = false;
}, 150);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}, 150);
}, 500);

Let's make debounce a little higher

Comment thread scripts/dev/index.mjs Outdated

// --- LOCAL SERVER ---
console.log('\nStarting local server...');
spawn('npx', ['serve', './out'], { stdio: 'inherit', shell: true });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we hold on to these PIDs so if something happens we can force kill them, e.g.

const spawn = (cmd, args) => {
  const child = spawn(cmd, args, {
    stdio: 'inherit',
    windowsHide: true,
  });

  children.add(child);
  child.once('close', () => children.delete(child));
  child.once('error', () => children.delete(child));

  return child;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants