Skip to content

How to reference compiled typescripts? #65

Description

@perNyfelt

I have a play application with a typescript in app/assets/javascripts/tableUtils.ts

SBT compiles this fine. I get the following output:
target/web/public/main/javascripts/tableUtils.ts
target/web/typescript/main/javascripts/tableUtils.d.ts
target/web/typescript/main/javascripts/tableUtils.js
target/web/typescript/main/javascripts/tableUtils.js.map

I want to reference tableUtils.js in a view but as the output js file is not in public the following does not work i.e:

<script type='text/javascript' src='@routes.Assets.at("javascripts/tableUtils.js")'></script>

These are the tsconfig compiler options i use:
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"emitDecoratorMetadata": false,
"experimentalDecorators": false,
"removeComments": true,
"noImplicitAny": false,
"noImplicitReturns": true,
"declaration": true,
"sourceMap": true
}

Is there a way to get the sbt-typescript plugin to output to the public dir or should the generated js files be referenced in some other way? Looking at the examples I was not able to figure it out.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions