JavaScriptServices icon indicating copy to clipboard operation
JavaScriptServices copied to clipboard

Angular2 sample error after adding project to source control

Open EduardTheThird opened this issue 10 years ago • 1 comments

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:

exception2 exception1

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?

EduardTheThird avatar Sep 15 '16 09:09 EduardTheThird

You have two main choices:

  1. 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
  2. Or, consider them to be fixed assets that you store in source control (in which case, remove them from your .gitignore or just force-add them to your repo (i.e., git add -f wwwroot\dist\vendor-manifest.json etc.))

Most people go with option 1, so that's the default setup. But if you prefer option 2, that works fine too :)

SteveSandersonMS avatar Sep 19 '16 08:09 SteveSandersonMS