Angular2 sample error after adding project to source control
Hi
Great work thus far, the templates are excellent, thank you!
When generating a new Angular 2 sample via Yeoman, the project works perfectly in Visual Studio 2015. Once the generated Angular 2 project is added to Git and a fresh branch thereof is checked out, the newly checked out branch does not build and gives the following error:
This is due to vendor.js being excluded by the generated .gitignore.
Running the following command manually before your first build after checkout: webpack --config webpack.config.vendor.js, fixes the issue. A similar issue was found on the React template, issue:99
Please could you recommend a workflow for this?
You have two main choices:
- Consider running
webpack(in both 'vendor' and 'regular' configs) to be part of your build, and hence you should expect to have to build those files before your app runs - Or, consider them to be fixed assets that you store in source control (in which case, remove them from your
.gitignoreor just force-add them to your repo (i.e.,git add -f wwwroot\dist\vendor-manifest.jsonetc.))
Most people go with option 1, so that's the default setup. But if you prefer option 2, that works fine too :)