-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Add npm support for main repository #4739
Comments
@wesleycho could you expand on the problem of "template distribution & inclusion"? Aside: I presume the default state should be to include all modules. This would allow the unwinding of modules to happen with time and experimentation. Also I feel I should jump in early, and encourage any future readers to check the older issue focused on bower #2196 for motivations. |
If building with Browserify, then browserify-shim + browserify-ng-html2js let you include the chosen modules given the raw source. Fairly minimal config, main thing is in figuring out the templates and javascript elements to pull in. The developer is then responsible for minifying the javascript, but if going the Browserify route they're probablly already doing so anyways (and probably already using browserify-ng-html2js for their own html templates) I could probably do a more in depth write up of how it works with an example that could be linked to. On the angular-ui/bootstrap side all that is needed is publishing into npm the /src and /template directories as is. |
@chad-autry thanks for that report - how about with Webpack? |
@wesleycho I've been keeping my build system extremely minimal, just calling Browserify commands stored in my package.json npm scripts. I don't have any experience with any other packaging frameworks. |
Looks like there are webpack solutions out there as well. |
+1 |
Meanwhile it's possible to specify path to tar archive in devDependencies which allows to set up custom build with just needed modules:
|
@dfsq thanks for the hint, works like a charm... i tried referencing the repo/commit, but that didn't get me anywhere |
@dfsq how do you reference the ui-bootstrap template files in your project? Especially the ones you can't configure (i.e. modal/backdrop.html) |
@joh-klein In our case we use webpack which can also import templates. It is also possible to set up build task (html2js) to pack those templates into $templateCache for only necessary modules (from BootstrapUI). |
Ok, nice. How about including the non-optional templates in the corresponding js files? For npm/bower that is. Or make all template paths user configurable? |
We should publish the main repository to npm so that users can conditionally include scripts as necessary to allow inclusion by feature instead of having to include the whole library in one bulk load & potentially loading excess scripts.
We need to figure out how to do this while supporting template distribution & inclusion.
The text was updated successfully, but these errors were encountered: