-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Disable core packages #216
Comments
I already came up with hack like
|
What's your use case? |
also that check is very incorrect; use |
@ljharb I just want to find modules installed in |
@ljharb Actually I used Object.property.hasOwnProperty and everything (it's just a short example), but thanks anyway! |
That’s not correct, though, because of the semver ranges. Use the isCore function. You can do that by appending a slash, just like you can in node. |
@ljharb Okay, but can I add core module to the list? |
Not without doing hacky unsupported things. What's your use case? |
@ljharb I'm trying to create a simple small module bundler. Can I submit a PR with support of adding or removing core modules? |
browserify already is a simple small module bundler, and already uses I don't think a PR is warranted here. |
@ljharb I'm not trying to create a module bundled because I don't know how to use them, but because I want to understand more how they work |
@ljharb My case is:
|
I think the fix could be |
@arikon Hrmm.... I just tried the following test with Node 10: $ npm init
$ npm install buffer
$ node -e console.log(require.resolve('buffer')) It resolves to Which package did you find that depends on |
Indeed, this is correct. Only bundlers would use the installed one (which can be chosen via some function options you can read about in the readme); |
@octogonz |
And I see they indeed do:
|
@ljharb In our case we are crawling This solution feels slightly clumsy, though. It would be ideal if |
You're right you'd need code like |
|
Another problem is that the error messages come back like this:
If I saw this error, my first thought would be "Oh, we must be accidentally appending a slash somewhere". |
Why would the slash be appended for a non-core module? or do you mean, in the case where you unconditionally append a slash. |
#233 has provided this. |
Thanks for implementing this! We'll use it!
Yes, to skip core modules we had to unconditionally append a slash, and then the resulting error message would have a weird slash in it. |
Hello. Can I disable all core packages support?
The text was updated successfully, but these errors were encountered: