I have generated a new Angular 18 project. I have noticed that it created a "public" folder instead of "src/assets", where does it come from?
It looks like this was used in previous versions and now it came back?
https://github.com/angular/angular-cli/issues/1942
I would like to generate a new project that uses "src/assets" folder, is there a setting or a parameter I can use so that it’s created automatically when generating a project or do I have to make the change manually after I generate the project?
>Solution :
Reading through the angular documentation it doesn’t look like there’s a parameter that you can pass to specify the assets folder path when using ng new
https://next.angular.io/cli/new
Luckily it shouldn’t take much to change the assets folder once the project is created. All you have to do is:
-
move the
publicfolder undersrc/ -
rename it into
assets
1a. Alternatively delete thepublicfolder and create thesrc/assetsfolder (since the folder only contains the favicon.ico file it shouldn’t be a problem) -
then change the
assetsvalue insideangular.jsonunderarchitect => buildandarchitect => test(that is, there should be 2 places where thepublicfolder is mentioned in theangular.jsonfile)"assets": [
{
glob": "**/*",
input": "src/assets"
}
]