angular - Copying node modules to wwwroot AspNetCore -
i working on aspnet core web application angular 2. since angular 2 requires node modules, install dependencies using package.json.
creates folder in solution level. since aspnetcore application reference can access wwwroot folder each , every time tend copy node modules folder manually wwwroot folder.
approach should fine long not adding new dependency. if keep on adding new packages painful copy manually every time.
solution ?
i wouldn't copy node_modules
wwwroot
folder, because contains lot of stuff you'll never need. copy needed stuff wwwroot
. best way so, using webpack. wrote lines in posts:
- http://asp.net-hacker.rocks/2016/09/19/aspnetcore-and-angular2-using-dotnetcli-and-vscode.html
- http://asp.net-hacker.rocks/2016/09/19/aspnetcore-and-angular2-using-dotnetcli-and-vscode.html
this posts using angular2, , outdated, concepts of using webpack still same. option use grunt or gulp copy needed javascript files wwwroot
:
hope helps
this pretty cool starter pack setup new project using asp.net core , angular: https://github.com/damienbod/angularwebpackvisualstudio
Comments
Post a Comment