1

I have imported five libraries in my .ts file as below. When I compile the file using TS 1.8 compiler it only add three imports to .js file resulting undefined VssService and ExtensionDataService. Does anyone know how to resolve this?

Imports in .ts file

import VssService = require('VSS/Service');
import ExtensionDataService = require('VSS/SDK/Services/ExtensionData');
import tl = require('vsts-task-lib/task');
import url = require('url');
import path = require('path');

Compiled .js

var tl = require('vsts-task-lib/task');
var url = require('url');
var path = require('path');

Thanks-

1
  • 404, can you update the link? Commented Feb 10, 2021 at 5:44

1 Answer 1

1

First, make sure you add VSS.d.ts reference.

Secondly, based on my test, it won’t generate related code if the variable not be used. I added console.log(VssService) and console.log(ExtensionDataService), then these code is generated.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.