Closed Jaeiya closed 8 years ago
LOL Yes, it should not work that way. It sounds like there's something wrong with your bundle config. Take a look at that and compare it to what we've got in the skeleton project that matches yours. My guess is that you've got an incorrect glob pattern.
Okay, I'll check that out. I tried asking about this on Gitter, but no one is available.
Well I've done everything I can to get this to work and it just won't. The configs match exactly. The aurelia dependencies are working properly, just not the view model scripts.
Are your file names and import statements matched in their casing?
Everything is lowercase, though Aurelia seems to be requesting an uppercase About.js
page, which doesn't make sense.
That's what is making my suspicious. Do a case sensitive search on your solution and your build folder to make sure you don't have that somewhere.
Okay, I've fixed the case issue. I was setting the route to About instead of about, but it's still not using the app-build file.
I think I've found the issue. I have .pug
files that I serve from the server so it will always need to request those. I set the view strategy using getViewStrategy()
on the view model to request the files without an extension. Using this method, Aurelia won't load the app from the app-build. If I remove the strategy, it will load the app just fine, except that it's requesting the wrong view (app.html
).
Is this a bug with Aurelia?
Edit
The only way to fix this currently is to tell my server that a request for an .html
file is actually a request for a .pug
file, which is easy to do, but not ideal. Maybe you have an idea on how to adjust the view strategy so that it will request without any extension and still serve the view model from the app-build
file?
Edit to Add Pug files are the new Jade template files. Company changed name.
Last Update Nope, turns out I was mistaking the app request for the app.js request. View strategy works as intended and all files are using the bundle now :)
I was wondering if there was some extra steps that are needed to force the application to use the bundled view model. As it is right now, my about page still makes a server request for the
about.js
file, instead of using the one bundled into theapp-build.js
. Now that I'm looking at it, even myapp.js
file is requested from the server instead ofapp-build.js
. This kinda defeats the purpose of bundling haha.