Rename default folders


#1

Is there a way to rename the default folders like the src folder?


#2

Hello,

I am very interessed why you wanna do that.

I think this makes things more complicated and forces more failures.

Keep in mind that on different places src/… path is relative hard coded, for example in tsconfig* or webpack* or… and each time you create a new project you have the same situation again.

So why?

Best regards, anna-liebt


#3

Anna,

I am of the idea that highly structured tools difficult the adoption of the same and therefore the growth of the community.

Especially when those structures directly attack the good practices of spoken language, as this is the case.

I think there should be more interdisciplinary professionals in design teams, since only to a person who lacks of good uses and customs of the language could happen to call src to a folder whose name should be sources.

I would also like to emphasize that Angular does not carry out these practices, allowing you to rename your folders and files based on the needs of each project.

I’m still waiting for a clear answer about the possibility of doing the aforementioned action.

Greetings.


#4

Well,

you could try changing in tsconfig.json (and if you use a customiced webpackconfig) and see whats happen.

Best regards, anna-liebt


#5

speaking of good practice, same for opening multiple issues about the same subject :wink:

your duplicate: Rename src/app/

anyway I follow @anna_liebt have you try to modify your tsconfig.json ?

"include": [
    "src/**/*.ts"
]

furthermore, if you read the README of Ionic app-script https://github.com/ionic-team/ionic-app-scripts you will find an option ionic_src_dir respectively --srcDir in chapter Overriding Config Values


#6

Reed,

speaking of good practice, same for opening multiple issues about the same subject :wink:

You caught me :upside_down_face:

anyway I follow @anna_liebt have you try to modify your tsconfig.json ?

This is the first thing I’ve tried even before publishing on this forum. As you can see in the duplicate post, the ionic serve command failed to build the application.

furthermore, if you read the README of Ionic app-script https://github.com/ionic-team/ionic-app-scripts 1 you will find an option ionic_src_dir respectively --srcDir in chapter Overriding Config Values

This could be the answer :thinking:

Thank you for your reply.


#7

Reed,

furthermore, if you read the README of Ionic app-script https://github.com/ionic-team/ionic-app-scripts 1 you will find an option ionic_src_dir respectively --srcDir in chapter Overriding Config Values

This worked @reedrichards! Thank you very much!

I’ve override the following values

  • ionic_src_dir
  • ionic_tmp_dir
  • ionic_app_entry_point
  • ionic_app_ng_module_path
  • ionic_app_ng_module_class

And then I’ve modify

"include": [
    "src/**/*.ts"
]

The application finally started!

Thank you very much for your advice!

Best regards,
Federico.


#8

Nice to hear it worked out :thumbsup::smiley:

P.S.: Don’t forget to mark your answer as the solution