Last post Feb 10, 2017 09:43 AM by damienBod
Feb 03, 2017 12:28 PM|UrielMhezzek|LINK
i used Asp.Core as backend und Angular 2 as frontend for my app. This is my first webapp. now i want to publish the app. i deploy the app to folder and now i want to load the data to my wwwroot of my IIS. But there are over 9000 small files. the copy-process
takes over 24 hours.
What can i do to make publish faster oder minimized my files?
Feb 03, 2017 05:32 PM|maherjendoubi|LINK
Hi Uriel Mhezzek,
You can use webpack to optimize copy-process time. Here is an excellent documented sample using like you did ASP.NET Core as backend and Angular 2 as frontend :
Feb 03, 2017 06:06 PM|PatriceSc|LINK
Also is this expected that you have so many small files? Could it be some kind of design issue (something like creating static pages for each existing product rather than using a db and having views showing data for any product you'll ever find in the database
Feb 05, 2017 02:45 AM|UrielMhezzek|LINK
Hello, the small files i talk about, doesn't come from me. They come from the Frontentframework Angular 2, so i can't change my design.
Feb 06, 2017 09:48 AM|Khuram.Shahzad|LINK
1: if the small files are necessary to copy then you can compress your solution and then upload it, it size should be reduced that will take less time.
2: If you use CDN references
it will save your time.
3: If you download through npm manager or bower then you can restore packages on your server. using relevant commands.
Feb 06, 2017 03:28 PM|UrielMhezzek|LINK
1, I transfer my files at this time with this soulution, but the decompress need time.
2. What is CDN and what change it?
3. I hope it independently deploy with this mechanism. what are the "relevant" commands.
Feb 06, 2017 08:01 PM|damienBod|LINK
You should bundle your client app properly. See the angular docs on deployment. Webpack is the best way. Use a seed or template which supports AoT and tree shaking.
I don't know what template you are using, but you should not be deploying lots of small files.
Feb 06, 2017 08:15 PM|FabianGosebrink|LINK
you can not solve the problem having too much files by using cdns. The amount of requests stays the same.
Either use webpack or SystemJs to bundle your application. Webpack is the better solution IMHO. One link was already given to you or you can take a look here:
This is one repository containing AngularJS, Angular (SystemJS) and Angular with webpack. AoT and Treeshaking included.
Hope this helps
Feb 07, 2017 09:11 AM|UrielMhezzek|LINK
i used this template http://blog.stevensanderson.com/2016/10/04/angular2-template-for-visual-studio/.
There is webpack installed, too. But i don' t know how does it right or wrong works. I create a new App with only the template and publish it.
It create a folder with many dll-files. And some Subfolders
I think the big problem ist the node_modules folder. Here i found the most files and thousands of subfolders.
Where does the folder comes from? My Project dosn't have a folder like this. Are these hidden behind the npm dependencies and are they restore automaticly at server when i start the app?
Feb 10, 2017 09:41 AM|damienBod|LINK
The template you chose does not support AoT or treeshaing (yet).
The node_modules folder is required to build the SPA application. It's created with npm install
This folder is only used to build the application, never deployed.
Feb 10, 2017 09:43 AM|damienBod|LINK
@Khuram Shahzad You should bundle the application and not download each dependency.