Skip to content

Is it possible to specify the AMD module (project) name during compilation? #4027

Closed
@sccolbert

Description

@sccolbert

I have a large library separated into many sub directories and modules which use ES6 module syntax. They are arranged on disk something like this:

src
  |- core
  |    foo.ts
  |    bar.ts
  | - ui
  |     baz.ts
  |     ham.ts

Instead of generating anonymous AMD modules and declaration files, I'd like to be able to specify a root path name and have the output explicitly define the module names, so that the files can be easily concatenated and minified:

foo.js

define('myproject/core/foo', [...], function() { ... } );

foo.d.ts

declare module 'myproject/core/foo' { ... }

Is there a way to do this with the current compiler flags or tsconfig?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueIn DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions