Reputation: 543
So, Im confused with the use of the new "magic' wwwroot folder. I get the concept, it's a placeholder for all things "content" to be served to the client. But when it comes to bundle/minify/ect it seems to do more harm than good. Since the 'wwwroot' folder is an actual folder, it has a path. But, you never referenced it like you would any other folder. So, when trying to request content from a URL I would say "http://myURL/images/imgone.img" but the image is inside the wwwroot/images folder. However, when I need to bundle I have to specify the folder. then, during minification it add the "wwwroot" to the reference inside CSS. I feel like im stuck in a circle here.
How has anyone dealt with this new "magic" folder from MS?
UPDATE: I have an old site, using DurandalJS, which in turn uses RequireJS. I have a gulp task (gulp-durandal) that bundles the JS files (My APP files and Durandal) into one single JS file. I use the bundle-minifier plug in to handle bundling the rest of the JS files (3rd party, ect). Problem is, inside the main.js file might look like this.
require.config({
catchError: {
define: true
},
waitSeconds: 200,
urlArgs: "v=" + (new Date()).getTime(),
paths: {
//text: "../Scripts/lib/require/text",
durandal: "../Scripts/lib/durandal/js",
plugins: "../Scripts/lib/durandal/js/plugins",
transitions: "../Scripts/lib/durandal/js/transitions",
async: "../Scripts/lib/require/async",
services: "services",
}
});
but if the scripts folder is located inside the "wwwroot" folder, it cannot be found. But I cannot specify the folder directly, because then when running development and requesting each file, it will try and bring it down from http://myURL/wwwroot/scripts/ect
Upvotes: -1
Views: 1058
Reputation: 28290
The folder wwwroot
is for your client historically called "static content". You can rename wwwroot
if you would like. Nowadays it is kind of logical separation between the app's client-side content and server-based code (which should not be inside wwwroot to prevent server-side code from being leaked.
Upvotes: 1