Elad Israeli
Elad Israeli

Reputation: 131

Folder Structure Angularjs doesnt know where to load the javascripts files

Edit: I want to emphasize that i dont know what is the proper solution or how to treat this situation .. im looking for answer how to manage it , and where do i need to load all of the files.

After Implementing this type of folder structure , i got some problem with extra javascript files , i dont know how should i need to make them work , in the usual way for every js file , i would add :

 <script type="text/javascript" src="script.js"></script>
 <script type="text/javascript" src="script2.js"></script>

..

to

<script type="text/javascript" src="script50.js"></script>

so lets assume that i have 50 javascripts files , do i need to link them all in the index.html page ? so i will have those line 50 times? it doesnt seem reasonable.

maybe i dont get this apporach can someone make it clear for me.

example of folder structure:

example of folder structure

so where do i need to "load" the scripts in the index.html ? maybe to gather them all into one file(like minify)?

Upvotes: 2

Views: 72

Answers (2)

Joe Clay
Joe Clay

Reputation: 35797

Look into Webpack - it's a little convoluted to set up initially (Pete Hunt's how-to might help), but as far as module bundling tools go it's probably one of the most powerful.

Upvotes: 0

oto lolua
oto lolua

Reputation: 499

If you use some build system you can use concat.

e.x for gulpjs https://www.npmjs.com/package/gulp-concat

Upvotes: 1

Related Questions