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

Does this webpack plugin will also work with Angular #10

Closed
rahulsahay19 opened this issue Mar 27, 2018 · 4 comments
Closed

Does this webpack plugin will also work with Angular #10

rahulsahay19 opened this issue Mar 27, 2018 · 4 comments

Comments

@rahulsahay19
Copy link

Hi Team,

Actually, I was working on one POC where in I need to dynamically load Module and its dependencies on runtime say there are two different solutions running from different repositories hosted on different domain. So, once I request the module from domain X, it should get resolved in domain Y.

Hence, just wanted to check whether this plugin will work for angular as well or this is only meant for react.

Thanks,
Rahul

@mastilver
Copy link
Owner

Hi

It should work. I'm not using angular myself but we have some test there: https://github.com/mastilver/dynamic-cdn-webpack-plugin/blob/master/test/core.js#L146-L173

But you will need to handle the peerDependencies yourself, maybe in the future this module will output needed peerDependencies but it's not defined yet (we might need it if some module or our provider bundle their peerDependencies)

If it's not working, please let me know :)
Ideally, it should work for every modules

Let me know what you are working on so, I can add it to the readme ;)

@rahulsahay19
Copy link
Author

Thanks for the info. Will check the same!

@rahulsahay19
Copy link
Author

Frankly speaking I am new to webpack hence trying to understand the same in bits and pieces. Point is let's say I have any angular app which is having some modules built in the same repository and some modules it can request let's say on certain action say whether on lazy routing or may be on application repload itself. In that case, it will look for some metadata.json file say, which will have name-value pair of dependencies say endpoint url, module name and its associated components. Then, once the same gets loaded from the bundler on runtime, it should get registered with main module. Registration part is not a problem, but loading modules on run-time is a problem. Therefore, I was thinking if you can provide some working sample around the same it will be great help. So far, I guess dynamic module in angular with webpack no body has done, everybody is using systemjs. But, I wanted to check with webpack itself. Hence, though to utilize your plugin. May be you can include this as example for your plugin as well, then many stack overflow qns will get resolved automatically.

Thanks,
Rahul Sahay

@mastilver
Copy link
Owner

Dynamic loading of arbitrary urls is not something that webpack was build for.
As you can see mastilver/dynamic-cdn-webpack-plugin#16 I'm running into the same issue. There is likely a way but I have no idea how dirty it would be

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