It looks like this is possible:
However, it appears that unless this dependency is included from async module, the code won't be included in the build output.
I think there should be more flexibility in how external dependencies are handled.
I think these should be the options:
- The code for the external resource is fetched during build time and included just like a file resource (if it's an asynchronous bundle the source code will come from one of the build output bundles not the external web server)
- The code for the external resource is kept external regardless of whether it is included asynchronously or synchronously
Currently, it looks like a JavaScript resource dependency with the "url" property is always associated with the external URL. If the dependency is not within an asynchronous bundle then the file is not included at all (this seems like a bug).
Do you think we can modify Dependency_js.js so that the external resource is fetched during build so that the output includes a snapshot of the file?