简体   繁体   中英

How to use Aurelia bundle for a MVC app

I am trying to use Aurelia bundle --force command with an Aurelia app hosted within a page of my MVC application.

When i try to run the command, I keep getting the following error:

info: Creating bundle ...
fs.js:549
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
Error: ENOENT: no such file or directory, open 'C:\Users\...\WebFrontend\index.html'

How do you change the location where aurelia bundle looks up for the index.html? My index.html is not in the root of the website. Furthermore, my aurelia 'index.html' is actually named settings.cshtml

UPDATE:

I finally got it working by putting my entire Aurelia app within a sub folder of my MVC app. Using post build events in my project, I got Aurelia-CLI to bundle my app. Within my setting.cshtml, I basically just reference the config.js and system.js.

This works great, but I need to rebuild the app each time I make a change which is not ideal. Still need to figure this one out.

Steve Sanderson made a template for Aurelia (that is no longer supported by Microsoft). https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/

You can also use the Aureali cli to create one.

This should work better now then in 2015.

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