Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Include separate modules in custom builds #5006

Closed
drKnoxy opened this issue Dec 3, 2015 · 1 comment
Closed

Include separate modules in custom builds #5006

drKnoxy opened this issue Dec 3, 2015 · 1 comment

Comments

@drKnoxy
Copy link

drKnoxy commented Dec 3, 2015

I thought it would be a cool feature if the 'Custom Builds' separated out each module. That way if i download and use the code for the datepicker, and then later download the code for dropdown I don't have two copies of position in my lib.

For example I make a custom build of the datepicker module and receive the following files:

  1. ui-bootstrap-dateparser-0.14.3.js and .min.js

    angular.module('ui.bootstrap.dateparser', [])
  2. ui-bootstrap-position-0.14.3.js and .min.js

    angular.module('ui.bootstrap.position', [])
  3. ui-bootstrap-datepicker-0.14.3.js and .min.js

    angular.module('ui.bootstrap.datepicker', [
        'ui.bootstrap.dateparser',
        'ui.bootstrap.position'
    ])
  4. ui-bootstrap-datepicker-tpls-0.14.3.js and .min.js
    Also I wanted to point out that templates use double quotes instead of singles, and it irks me to see them mixed when i view -tpl.js file

    angular.module('ui.bootstrap.datepicker.tpls', [
        'template/datepicker/datepicker.html',
        'template/datepicker/day.html',
        'template/datepicker/month.html',
        'template/datepicker/popup.html',
        'template/datepicker/year.html'
    ]);
  5. And concatenated copies where ui.bootstrap is the only module you need to import

    ui-bootstrap-custom-0.14.3.js
    ui-bootstrap-custom-0.14.3.min.js
    ui-bootstrap-custom-tpls-0.14.3.js
    ui-bootstrap-custom-tpls-0.14.3.min.js

    angular.module('ui.bootstrap', [
        'ui.bootstrap.datepicker',
        'ui.bootstrap.datepicker.tpls', // conditionally included
        'ui.bootstrap.dateparser',
        'ui.bootstrap.position'
    ]);
    // and then all of the modules concatenated below

This might be an interesting update for the docs revamp ticket #4798

@wesleycho
Copy link
Contributor

We probably won't support this specifically, but keep an eye out for #4739 - with CommonJS via Browserify or Webpack, one will then be able to require only what one needs.

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

No branches or pull requests

2 participants