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

Will Parcel 2 feature externals or aliases without requiring url #3137

Closed
afridley opened this issue Jun 7, 2019 · 2 comments
Closed

Will Parcel 2 feature externals or aliases without requiring url #3137

afridley opened this issue Jun 7, 2019 · 2 comments

Comments

@afridley
Copy link

afridley commented Jun 7, 2019

❔ Question

In the Parcel 2 RFC #1952 (comment)
There is discussion of handling externals through aliases in the following way

"aliases": {
  "react": {
     "url": "https://unpkg.com/react@16.4.2/umd/react.production.min.js",
     "global": "React"
   },
   "datatables": { 
     "url": "//cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css",
     "global": null
   }
}

I am wondering if this will this work with out a url? In case you want to replace a module (@wordpress/blob) with a value (wp.blob) to be used to retrieve a global (wp.blob) variable.

example from webpack

{ 
  externals: { 
    '@wordpress/blob': 'wp.blob'
   }
}

Or will this type of behavior not be supported by aliases?

🔦 Context

Right now Parcel does not ignore externals or you need to setup additional steps per external which can become tedious.
example
#144 (comment)

🌍 Your Environment

Software Version(s)
Parcel 1.12.3
Node 10.16.0
npm/Yarn 1.13.0
Operating System MacOs
@devongovett
Copy link
Member

We haven't talked much about externals yet, but this is good to consider. Thanks for bringing this back up.

I think maybe it could still work with aliases:

"aliases": {
  "react": {
     "global": "React"
   }
}

@devongovett
Copy link
Member

Closing in favor of #3305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants