镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Expose transformations as a public API #13764

Description

@rbuckton

Expose the transformFiles and getTransformers functions as a public API.

Activity

  1. dherges commented on Nov 8, 2017

    @dherges

    Hi Ron Buckton (@rbuckton),

    is there documentation on the transformations API? (#13940)

    Here is a blog post http://blog.scottlogic.com/2017/05/02/typescript-compiler-api-revisited.html

    My use case is inlining external resources into TypeScript from decorator metadata (more specific: Angular components):

    Source Code:

    @Component({
      templateUrl: './foo.component.html'
    })
    export class FooComponent {}

    Expected transformed result will be similar to:

    @Component({
      template: '<h1>Content from foo.component.html here...</h1>'
    })
    export class FooComponent {}

    (and then compiled to es2015 syntax / es2015 module format)

    --- edit ---

    Use case is close to #13940 (comment)

    Is it possible to transform-and-compile?

  2. geovanisouza92 commented on Dec 22, 2017

    @geovanisouza92

    I'm looking for inlining things too (XML in my case).

    Currently I'm using webpack loaders (have used babel-preval before, but it doesn't work with TS).

  3. locked and limited conversation to collaborators on Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Domain: API: TransformsRelates to the public transform APIFixedA PR has been merged for this issueSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions