vercel / vercel/ncc

How to rewrite code to include files with dynamic path

Open
#489 1 comment 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
9.8k
Forks
326
PR merge metrics
No merged PRs in 30d

Description

I'm trying to use glob.sync with path.resolve with no luck.
Is there anything I can change to get this working?

The files I'm trying to get working need to be bundled as they're part of the app.

const path = require('path');
const glob = require('glob');

const files = glob.sync(path.resolve(`${__dirname}/*.js`));

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the shown glob.sync(path.resolve(...)) example with ncc, using the __dirname and dynamic *.js path from the issue. Trace how ncc handles the glob result and bundled files, then define done as a documented or reproducible resolution for including those files.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.