Changing Ionic 2 www folder


I’m looking to create a project that mixes Ionic, Asp.Net core and is hosted on Azure at least during testing and development. I’ve set up an Asp.Net core app that uses wwwroot as it’s base path. What I’d like to do is place the ionic app in the same project and have the ability to do both Ionic and WebApi on the same server at least during testing and development.

I’ve managed to change the root folder to www so all the ionic files are available, this works local but not hosted on azure. My next attempt is to try and make ionic put it’s files in the wwwroot folder instead of www. I changed the document root in the ionic.config.json file but during build ionic still places the files /build in the www floder.

How can I get Ionic to put the files in the wwwroot instead of www?



I guess that you have to make a few changes to the build process, check out the linked post for details:

Thanks but it looks like there are a lot of places I would need to tweak to adjust this. Searching the folder for www/build shows a fair few hardcoded instances. I think I’ll leave Ionic and tweak the Azure instance instead :slight_smile:

I think that in theory it should be possible to achieve it only by passing the appropriate options to the gulp tasks in gulpfile.js. A quick search returned the following results in the ionic-gulp-tasks repo and all of them seem to be configurable. Are there any other places?

If you’re using Ionic 2 then you can use “ionic-app-scripts” with npm

More info: (the section you want is “Overriding Config Values”)