I am facing an issue with my development setup: I have a .net Wepapi project as Backend and a Frontend written with Angular2, both included in a visual studio solution. While the build works fine locally, it fails when using the TFS Online build in my CD Pipeline. The error message I receive is:
Build: Cannot find module '@angular/core'.
along with some other related errors.
Here is my package.json file content:
{
"name": "emersy",
"version": "1.0.0",
// More code...
}
This is my typings:
{
"globalDependencies": {
// Typings information...
}
}
And here is my tsconfig:
{
"compileOnSave": true,
"compilerOptions": {
// Compiler options...
}
}
Note that I use xaml build and not the new build engine.
This is my systems.js.config:
(function (global) {
System.config({
// System config settings...
});
})(this);
EDIT1: After migrating to vnext build, the deployment on my Azure app was successful but the Angular code does not work. I get the following error:
mysite.azurewebsites.net/:38 Error: (SystemJS) Unexpected token <
SyntaxError: Unexpected token <
Evaluating http://mysite.azurewebsites.net/app/main.ts
Error loading http://mysite.azurewebsites.net/app/main.ts
It seems like npm modules are not being copied properly.
Here is my build configuration: https://i.sstatic.net/LDbwC.png
EDIT 2: https://i.sstatic.net/3mzul.png
https://i.sstatic.net/blKyF.png
EDIT 3: MSBuild Arguments
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=$(build.stagingDirectory)