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:

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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -