Skip to content

fix external module detection on Windows#89

Merged
jaredpalmer merged 1 commit intojaredpalmer:masterfrom
a-type:fix-windows-external-modules
May 8, 2019
Merged

fix external module detection on Windows#89
jaredpalmer merged 1 commit intojaredpalmer:masterfrom
a-type:fix-windows-external-modules

Conversation

@a-type
Copy link
Copy Markdown
Contributor

@a-type a-type commented May 8, 2019

Fixes #87

Absolute path detection was not working for Windows users. I updated the util to use Node's built-in function.

I also created a regression test in the testing suite to ensure that exports defined in other files are correctly included in the final library build.

@a-type
Copy link
Copy Markdown
Contributor Author

a-type commented May 8, 2019

Another problem that's related: the default tsconfig.json adds src/* to the paths, but doing so means that TS will resolve auto-imported modules relative to src (so if I auto-imported something from src/utils.ts, it would come in as import { foo } from 'utils'. This causes these modules to also be marked as external. That's likely to confuse people. Either the default tsconfig shouldn't use the absolute resolution in src, or the external check will need to be made a bit smarter. I consider that outside the scope of this particular issue (Windows support out of the box).

@jaredpalmer
Copy link
Copy Markdown
Owner

Nice.

@jaredpalmer jaredpalmer merged commit 78bb42f into jaredpalmer:master May 8, 2019
@a-type a-type deleted the fix-windows-external-modules branch May 8, 2019 21:13
@agilgur5
Copy link
Copy Markdown
Collaborator

@allcontributors please add @a-type for code, test, bug

@allcontributors
Copy link
Copy Markdown
Contributor

@agilgur5

I've put up a pull request to add @a-type! 🎉

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.

Relative imports are treated as external on Windows

4 participants