Skip to content

amdloader path should be relative to reference file and not outDir #41

Open
@jeffmay

Description

@jeffmay

If you have a project like so:

public/
  app/
    main.ts
    reference.ts
  test/
    reference.ts

then when you attempt to compile them both into the same directory with an AMD loader...

target/
  js/
    app/
      main.ts
      reference.js
      amdloader.js
    test/
      reference.js

the outDir is "target/js" so the paths in amdloader are all set to "./../main.js" instead of "./main.js".

We should think about how we want to handle multiple reference files in a project. Maybe a separate ticket for this?

In this case, it would be simple enough to allow the user to specify the root path of the AMD loader (configuration is always a good option since people -- like myself -- always have exotic needs).

Alongside this though, I think we could more wisely default to using the path to reference file's directory appended with references (and then normalize the paths?)

@basarat what do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions