0

I am trying to add a grunt build file to my angular site :

right now my structure is as follows :

-index.html
-/css
-/images
-/app
   -/core
   -/services
   etc

So my Index.html has links such as

app/core/coreServices.js

This works fine at the moment, but if I bring grunt into the equation which will build my site into a /dist folder, all references to app => dist etc.

Should everything be in the app folder instead including index.html,/css,/images

Hard to see what the best standard out there is with angular and grunt, nearly everyone does it different

StevieB
  • 6,263
  • 38
  • 108
  • 193
  • http://stackoverflow.com/questions/26140235/where-should-i-keep-the-angularjs-files-in-my-web-application-and-how-should-i-s/26458875#26458875 Can you check my answer in this post. Hope it will help you – Aditya Sethi Dec 14 '15 at 16:23
  • It's really opinion based in how you like to set up folders, and you can set your build process to conform to your desired folder structure so it's really dependent upon how you like to work. – ajmajmajma Dec 14 '15 at 16:24

1 Answers1

0

This is a question with a lot of answers. Everything should be in the app folder yes, but as for the file structure, there are a lot of ways you can go. I would recommend you to take a modular approach, and keep all files related to, for example, a user, in the folder user. As the app grows you will find it easier to maintain.

As for the grunt, it is configurable, so basically you don't have to adjust your folder structure to it. You will just configure the path to desired files in the Gruntfile.js.

I would strongly suggest you do a little research on the subject and find the way most suited for yourself. This is something to get you started, where I found a lot of answers , its a great read: https://github.com/johnpapa/angular-styleguide#application-structure

Bata
  • 651
  • 3
  • 7