-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Do not try to import data: tel: mailto: something: URLs #50
Conversation
Found out that Parcel needs to ignore all |
src/utils/is-url.js
Outdated
@@ -1,5 +1,5 @@ | |||
const isURL = require('is-url'); | |||
|
|||
module.exports = function (url) { | |||
return isURL(url) || /^#/.test(url); | |||
return isURL(url) || /^#/.test(url) || /^[a-z]*\:/i.test(url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we hoist these regexes into constants and add descriptions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thejameskyle Done
Yep 👍. Try to do this tonight.
Envoyé de mon iPhone
… Le 6 déc. 2017 à 16:43, David Nagli ***@***.***> a écrit :
@davidnagli commented on this pull request.
In src/utils/is-url.js:
> @@ -1,5 +1,5 @@
const isURL = require('is-url');
module.exports = function (url) {
- return isURL(url) || /^#/.test(url);
+ return isURL(url) || /^#/.test(url) || /^[a-z]*\:/i.test(url);
+1
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks! |
* Ignore data URLs * Add tests * Ignore tel and mailto URLs * Hoist regexes into constants
* Ignore data URLs * Add tests * Ignore tel and mailto URLs * Hoist regexes into constants
add aliasField option to NodeResolver Approved-by: Maia Teegarden
Parcel is trying to "import" data URLs. This PR ignore URLs when they start with
data:
.