Different source folder than "src" not working

Even when configuring the config variable “ionic_src_dir” to “app” for example it still fails.
I get this output:
Error reading template file, "login.html": Error: ENOENT: no such file or directory, open 'C:\dev\ionicproject\src\pages\login\login.html'

So it seems that the build still is hardcoded for ‘src’ even though the variable is set to ‘app’

On a side note, I’m really frustrated with Ionic at this point. But it’s my fault, shouldn’t have jumped on the beta train (customer’s wish though)

You have to change the templateUrl: property in your .ts file.

It will probably still be pointing to the build folder.

I had the same error this morning but managed to fix when updating this property.


It’s not that. I updated these paths to have them relative, so that is fine.

I solved it by doing the following: (taken you want to switch from folder ‘src’ to ‘app’; how it was in the betas):

  • create a custom rollup.config.js by copying the default one and call ngTemplate like this:

ngTemplate({ directoryMaps: { '.tmp': 'app' } }),

  • In the package.json set the following config value:

"config": { "ionic_src_dir": "app", ... }

Ah I see,

Didn’t read the post properly.

Hopefully it might help someone out who forgets to change like I did! :relaxed:

Glad you managed to find a fix