requirejs / almond

A minimal AMD API implementation for use after optimized builds
Other
2.42k stars 169 forks source link

Creating reusable libraries with RequireJS & AlmondJS #118

Open SkyIsTheLimit opened 8 years ago

SkyIsTheLimit commented 8 years ago

Hi,

I'm trying to create a large application using requirejs and angular. The idea is to be able to compose applications of smaller reusable components developed and packaged using requirejs.

I have created a small component with just a single file and built it to an optimized file using wrap and almondjs to create a self contained module that can be included with other requirejs applications. The problem that I'm facing now is that internally within my smaller component I require angular as a dependency but do not include it with the optimized version of the component because other components would also be built on angular and I wouldn't want to include angular with every component. It would make more sense to be able to use angular from the main application in which these components are included. However, by using almond to create a reusable module, the individual component modules have lost the context of the parent application and hence cannot load angular using the configuration of the parent application.

Is there something I can do about this?

Legends commented 7 years ago

DEAD!