1.0.6 • Published 7 years ago

tsc-resolve v1.0.6

Weekly downloads
239
License
MIT
Repository
github
Last release
7 years ago

tsc-resolve

A tool for resolving typescript modules defined in tsconfig.json

Why tsc-resolve?

Installation

# Local package
$ npm i tsc-resolve --save-dev

# Global CLI
$ npm i -g tsc-resolve 

Usage

NPM task

$ npm i tsc-resolve --save-dev

"scripts": {
    "compile": "tsc",
    "build": "compile && tsc-resolve"
}

$ npm run build

CLI

$ npm i -g tsc-resolve

$ tsc-resolve
$ tsc-resolve -p tsconfig.prod.json
$ tsc-resolve -p ./conf/tsconfig.dev.json
$ tsc-resolve -p ./conf/
$ tsc-resolve -p ../

TypeScript

import { tscResolve } from "tsc-resolve"
import * as path from "path"

// Simple ./tsconfig.json
const configPath = process.cwd();
tscResolve(configPath)
    .then(() => { /*DONE*/ });

// Specific tsconfig.json
const configPath = path.join(process.cwd(), "tsconfig.prod.json");
tscResolve(configPath)
    .then(() => { /*DONE*/ });

// Specific tsconfig.json in different folder
const configPath = path.resolve(process.cwd(), "../conf/tsconfig.dev.json");
tscResolve(configPath)
    .then(() => { /*DONE*/ });

// Async/Await
const configPath = process.cwd();
await tscResolve(configPath);

JavaScript

const tscResolver = require("tsc-resolve");
const path = require("path");

// Simple ./tsconfig.json
const configPath = process.cwd();
tscResolve(configPath)
    .then(() => { /*DONE*/ });

// Specific tsconfig.json
const configPath = path.join(process.cwd(), "tsconfig.prod.json");
tscResolve(configPath)
    .then(() => { /*DONE*/ });

// Specific tsconfig.json in different folder
const configPath = path.resolve(process.cwd(), "../conf/tsconfig.dev.json");
tscResolve(configPath)
    .then(() => { /*DONE*/ });

// Async/Await
const configPath = process.cwd();
await tscResolve(configPath);
1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago