1.0.13 • Published 8 months ago

@nartallax/ts-build-utils v1.0.13

Weekly downloads
-
License
0BSD
Repository
github
Last release
8 months ago

@nartallax/ts-build-utils

A collection of utility scripts that help with build process of TypeScript projects.
Powered by ESBuild, @chialab/esbuild-html-plugin, dts-bundle-generator and more.

Install

npm install --save-dev @nartallax/ts-build-utils

Use

// Main entrypoint of this package is buildUtils function:
import {buildUtils} from "@nartallax/ts-build-utils"

// This function accepts parameters describing your project
// and creates a bunch of other functions
// (not everything listed here, be sure to check typedefs):
const {
  clear, 
  build, 
  runTests, 
  copyToTarget, 
  publishToNpm, 
  serve
} = buildUtils({
  buildOptions: {
    entryPoints: ["./src/index.html"]
  }
})

// buildUtils() assumes a lot of stuff,
// like that project has tsconfig.json, 
// and that tsconfig.json has rootDir set;
// this may not always be true, but that's checked, 
// so if something is not there - the script will tell you.
// also override options are there for almost everything;
// you can pass various options to most util functions.

// after acquiring the utils, you may use them to describe your build process:
await clear()
switch(process.argv[2]){
  case "dev": {
    await serve()
  } break

  case "test": {
    await runTests({nameFilter: process.argv[3]})
  } break

  case "publish": {
    await build()
    await copyToTarget("README.md", "LICENSE", "package.json")
    await publishToNpm({dryRun: true})
  }
}
1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago