aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

what does the `inject` config parameter do? #97

Closed davismj closed 8 years ago

alvarezmario commented 8 years ago

I guess is related to jspm inject ...

davismj commented 8 years ago

As far as I can tell, when set to true it modifies your config.js to register a bundle mapping; when set to false it instructs SystemJS to automatically register a new bundle mapping whenever the bundle is included in your application, either through a <script> tag or an import statement.

ahmedshuhel commented 8 years ago

It creates a map/registry of the modules included in a configured bundle and inject into the config.js file. As @alvarezmario pointed out, it is related to jspm bundle --inject. SystemJS uses this to load the bundle on demand.

  bundles: {
    "app-build": [
      "welcome.html!github:systemjs/plugin-text@0.0.2",
      "users.html!github:systemjs/plugin-text@0.0.2",
      "nav-bar.html!github:systemjs/plugin-text@0.0.2",
      "child-router.html!github:systemjs/plugin-text@0.0.2",
      "app.html!github:systemjs/plugin-text@0.0.2",
      "app",
      "blur-image",
      "child-router",
  ...