简体   繁体   中英

How to include aurelia-dialog into bundle with Aurelia?

I use aurelia-dialog in my web application and everything works fine.
But when I export (glup export) this application, I have this error when loading:

Error: XHR error (404 Not Found) loading http://localhost/myApp/jspm_packages/npm/aurelia-dialog@0.5.10/resources/ai-dialog.html Error loading http://localhost/myApp/jspm_packages/npm/aurelia-dialog@0.5.10/resources/ai-dialog.html!http://localhost/myApp/jspm_packages/github/systemjs/plugin-text@0.0.3.js Error loading http://localhost/myApp/jspm_packages/npm/aurelia-dialog@0.5.10/resources/ai-dialog.html!template-registry-entry

My bundles.js content :

....
"dist/aurelia": {
  "includes": [
    "aurelia-framework",
    "aurelia-bootstrapper",
    "aurelia-fetch-client",
    "aurelia-router",
    "aurelia-animator-css",
    "aurelia-templating-binding",
    "aurelia-polyfills",
    "aurelia-templating-resources",
    "aurelia-templating-router",
    "aurelia-loader-default",
    "aurelia-history-browser",
    "aurelia-logging-console",
    "aurelia-event-aggregator",
    "bootstrap",
    "bootstrap/css/bootstrap.css!text",
    "aurelia-dialog",
    "aurelia-i18n",
    "text",
    "i18next-xhr-backend",
    "fetch"
  ]
  .....

Any ideas?

Just include its .html (and .css ) files too.

....
"dist/aurelia": {
  "includes": [
    "aurelia-framework",
    "aurelia-bootstrapper",
    "aurelia-fetch-client",
    "aurelia-router",
    "aurelia-animator-css",
    "aurelia-templating-binding",
    "aurelia-polyfills",
    "aurelia-templating-resources",
    "aurelia-templating-router",
    "aurelia-loader-default",
    "aurelia-history-browser",
    "aurelia-logging-console",
    "aurelia-event-aggregator",
    "bootstrap",
    "bootstrap/css/bootstrap.css!text",
    "aurelia-dialog",
    "aurelia-dialog/resources/ai-dialog*.html!text", // <- like this
    "aurelia-dialog/dialog.css!text", // <- CSS file
    "aurelia-i18n",
    "text",
    "i18next-xhr-backend",
    "fetch"
  ]
  .....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM