gulp - How properly to bundle an aurelia plugin that html files, js files, and dependencies? -


situation

we using fork of benib/aurelia-leaflet in our app.

jspm install github:shaunluttin/aurelia-leaflet 

the plugin includes original in installation dependency , results in following installation.

jspm_packages   github     leaflet              <----- original       leaflet@0.7.7         dist            images           leaftlet.css           leaflet.js           leaflet-src.js      <----- dependency       leaflet@0.7.7.js     shaunluttin       aurelia-leftlet@0.1.2       <----- aurelia plugin         helpers         aurelia-leaflet-exceptions.js         index.js                         <----- dependency         leaflet.html         leaflet.js         leaflet-defaults.js       aurelia-leaflet@0.1.2.js 

these module definitions pointing dependencies.

leaflet@0.7.7.js

define(["github:leaflet/leaflet@0.7.7/dist/leaflet-src"], function(main) {   return main; }); 

aurelia-leaflet@0.1.2.js

define(["github:shaunluttin/aurelia-leaflet@0.1.2/index"], function(main) {   return main; }); 

to improve performance, we're bundling aurelia-leaflet this:

"dist/leaflet-bundle":   "includes": [     "shaunluttin/aurelia-leaflet",             "shaunluttin/aurelia-leaflet/*.js",     "shaunluttin/aurelia-leaflet/leaflet.html!text"     ], 

gulp bundle uses aurelia-bundler create following bundle.

"leaflet-bundle.js" : [   "github:leaflet/leaflet@0.7.7.js",   "github:leaflet/leaflet@0.7.7/dist/leaflet-src.js",   "github:shaunluttin/aurelia-leaflet@0.1.2.js",   "github:shaunluttin/aurelia-leaflet@0.1.2/aurelia-leaflet-exceptions.js",   "github:shaunluttin/aurelia-leaflet@0.1.2/helpers/layer-factory.js",   "github:shaunluttin/aurelia-leaflet@0.1.2/index.js",   "github:shaunluttin/aurelia-leaflet@0.1.2/leaflet-defaults.js",   "github:shaunluttin/aurelia-leaflet@0.1.2/leaflet.html!github:systemjs/plugin-text@0.0.3.js",   "github:shaunluttin/aurelia-leaflet@0.1.2/leaflet.js" ] 

the bundling includes original leaftlet because aurelia-leaflet specifies dependency in index.js file.

question

is there way bundling of aurelia-leaflet without having specify each file type? seems verbose:

"dist/leaflet-bundle":   "includes": [     "shaunluttin/aurelia-leaflet",             "shaunluttin/aurelia-leaflet/*.js",     "shaunluttin/aurelia-leaflet/leaflet.html!text"     ], 


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -