Configuring aurelia cli to submit an application package from a subfolder

How to configure aurelia cli so that the application can be downloaded from a subfolder (mvc controller with view)?

Q /MyController/MyViewI have the following code

<div aurelia-app="main" data-module="app2">
     <script src="/scripts/vendor-bundle.js" data-main="aurelia-bootstrapper"></script>
</div>

I have 404 when the bootloader then tries to download the application package from /MyController/MyView/scripts/app-bundle.js, but its actual location/scripts/app-bundle.js

Thanks for any help

Larsi

Motivation for the question: I use Aurelia on the existing asp.net mvc 5 website. We plan to develop new pages as small aurelia applications (one aurelia application for mvc). We plan to reuse the same nodes in all views (just by setting "aurelia.setRoot ('nameofapp") to run the correct application. It seems to work fine when run in' / ', but when used with' / MyController / MyView 'we need to change the location from which the application packages are downloaded - and this question speaks about this.

+4
source share
2 answers

Two things must be done:

  • Set'build.targets.baseUrl: '../scripts'' to 'aurelia.json'
  • "", .

, - , : https://github.com/larserikfinholt/aurelia-subfolder

Larsi

+4

""

main.js aurelia bootstrap :

main.js

configure(aurelia) {
  aurelia.use
    .standardConfiguration()
    .feature('my-app');
}

aurelia my-app/index.js , aurelia configure(), main.js. , .

-/index.js

configure(aurelia) {
  aurelia.start().then(() => aurelia.setRoot('my-app/app.js'));
}
+3

Source: https://habr.com/ru/post/1649892/


All Articles