ASP.Net Core Generator adds wwwroot to script urls
See original GitHub issueThe ASP.Net Core Generator is properly placing the transpiled and bundled scripts in wwwroot\scripts
. Unfortunately, wwwroot
is being written to the paths placed in requirejs.config
in vendor-bundle.js
. This means that requirejs tries to load wwwroot/scripts/app-bundle.js
instead of scripts/app-bundle.js
. This keeps the Aurelia app from properly loading.
When I hand edit vendor-bundle.js
to change the location for app-bundle.js
from
"app-bundle": "../wwwroot\\scripts/app-bundle"
to
"app-bundle": "../scripts/app-bundle"
the aurelia app runs successfully.
Also, all of the instances of \\
can simply be replaced with /
in aurelia.json
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Adding script references in ASP.NET CORE control - Syncfusion
This section provides information about reference scripts from CDN and Custom resource generator (CRG) for Syncfusion ASP.NET Core controls.
Read more >Configure ASP.NET Core to work with proxy servers and load ...
Learn about configuration for apps hosted behind proxy servers and load balancers, which often obscure important request information.
Read more >Dealing with Application Base URLs and Razor link ...
I want to have multiple microsites (the main page, the podcast, the blog, etc) with regular backups, CI/CD pipeline (check in code, go...
Read more >Map to wwwroot in ASP.Net 4? - Stack Overflow
Create HttpHandler for handling request to specific file extensions. And modify the file real path using provided file relative path from the URL....
Read more >Routing in Razor Pages
Areas were introduced to Razor Pages in ASP.NET Core 2.1. Routes to resources in areas have the name of the area as the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In version 0.23.0 I just needed to change build>targets>output in aurelia_project/aurelia.json to “wwwroot/scripts” from “scripts”. So it seems the issue still persists.
@EisenbergEffect, I have a workaround for this which means you don’t have to manually edit the vendor-bundle.js every time. Maybe the solution could be incorporated, but I don’t feel confident enough with this repository yet to make a pull request.
In the aurelia_project/aurelia.json file, add the following additional property:
Then, make a small edit in
node_modules/aurelia-cli/lib/build/bundle.js
as follows:In the
createRequireJSConfig
method, replace the following line:with this line:
Hope this helps!