module - typescript require() needs to include the folder the file is in - sometimes -
I have a case where I was imported:
import docHeader = Requiring ('doc-header'); Import list body = requires ('list-body'); and failed to say that they were unable to list the JS file and URLs were missing. So I changed them to:
import docHeader = required ('document / doctor-header'); Import list body = requires ('document / list-body'); The thing is, I have the file setup / call stack in this file document folder.
layout / worker-api.ts:
import document = required ('document / document'); // ... var doctor = new document Document (); Doc.deserialize (results.document); layout / document / document.ts:
requires import docHeader = ('document / doctor-header'); Import list body = requires ('document / list-body'); // ... export class document {public guide: string; Public Doctor Header: docHeader.DocHeader; Public body: listBody.ListBody; Other files: Layout / Document / Doctor-Header. Layout / Document / List-body.TT
Is it possible because the call stack starts with the worker -PITSSSS Is it the default directory? Everywhere all my import work is in line with expectations and of course, the folder is required based on this error message.
module name in requiredJS, unless explicitly used, according to the base URL resolved are given. For example, if a script tries to load a script from http://example.com/foo/bar , then cat , the Hull URL http: / will be /example.com/cat . You can resolve this by specifying a relative module name, such as . / doc header . TypeScript will also respect these relative paths.
Comments
Post a Comment