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

support for relative external path (--external:../../module.js) #127

Closed
richardpramono opened this issue May 21, 2020 · 2 comments
Closed

Comments

@richardpramono
Copy link

I tried to exclude an external module which located at upper folder of the project location:
eg:
esbuild index.js --minify --external=../../sha256.min.js

but it says Invalid module name.

@evanw
Copy link
Owner

evanw commented May 21, 2020

Yeah right now that only accepts module names, not file paths. That could be a feature to add.

What's your use case for excluding a file from an upper folder? Is it a package nested inside another package? Do you not have control over the outer package? Also: are you bundling for node or the browser?

@richardpramono
Copy link
Author

My case is that I'm building a library that use sha256 library. But that external sha256 library is used by other project too, and I don't want to include it in the build.

But now I have found temporary solution: first, change the ../../sha256.min.js. into sha256.min.js, build it with external. Then find the filename, and add ../../ haha.. but it works now.. I hope you can add ../../ support in the external feature in the future..

Thanks~

@evanw evanw changed the title support for relative upper folder path exclude (--exclude:../../module.js) support for relative external path (--external:../../module.js) Jun 22, 2020
@evanw evanw closed this as completed in 66fb3f5 Jul 4, 2020
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

No branches or pull requests

2 participants