Skip to content

how to use it but cli? #1374

@takegine

Description

@takegine
//package.json
"scripts": {
    "build": "tstl -p src/vscripts/tsconfig.json"
}
// src/vscripts/tsconfig.json
{
    "include": [
        "../vscripts",
        "../shared",
        "../service"
    ],
    "compilerOptions": {
        "outDir": "../../dist"
    },
    "tstl": {
        "luaTarget": "JIT",
        "sourceMapTraceback": true,
    }
}

I used to compile with this line of instructions,For some reasons, I want to execute through *. ts. but It doesnt work.

import { join } from "path";
import { transpileProject } from "typescript-to-lua";

const result = transpileProject(
    join(__dirname, 'src', "tsconfig.json"),
    {
        rootDir: join(__dirname, 'src'),
        outDir: join(__dirname, 'dist' )
    });
console.log(result.diagnostics);
// src/tsconfig.json
{
    "include": [
        "../src",
        "../shared",
        "../service"
    ],
    "tstl": {
        "luaTarget": "JIT",
        "sourceMapTraceback": true,
    }
}

I want to configure the input directory and output directory in the script, not in the cli

can you help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions