Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

When using TypeScript dependencies from node_modules are not bundled. #49

Description

@danthedaniel

None of my required files make it into the bundle if they're from node_modules. I've tracked this down to the function isJs in lib/explore.js:

const isJs = (fileList, path) => {
  const file = fileList.files.get(path);
  return file && file.type === 'javascript';
};

Because my paths are being transformed (eg: js/views/not_found.tsx to js/views/not_found.js) this function does not work correctly. I've been able to fix the issue by changing it to:

const isJs = (fileList, path) => {
  return /\.(js|ts|tsx|jsx)/.test(path);
};

Oddly, this issue only emerged after I switched to a fork of typescript-brunch (specifically this) and when I try to switch back to the official package the problem persists. I've even gone as far as wiping my node_modules folder and redownloading all of my dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions