Shirtiny / utils

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ts-lib-template

A starter template for typescript library.

# init project
yarn
# build
yarn build

# tag and version
make version
# publish to npm
make publish

# dev
yarn start

Introduction

This is a template for typescript library base on esbuild. This template includes followings:

  • TypeScript

  • Esbuild

  • Makefile

  • Dev server

  • Env

  • Prettier

  • Eslint

  • Jest

  • Sass/scss & Autoprefixer

  • Github action

Usage

Create your repository by clicking 'Use this template' top of the page.

Config

// .sh.js
module.exports = {
  // your lib global name
  globalName: "tsLibTemplate",
  // the output prefix name, default is 'main', please check your package.json after this option changed.
  outputFileName: "main",
  // devServer option
  devServer: {
    host: "localhost",
    port: 2021,
    proxy: {
      "^/api": {
        target: "http://192.168.6.111:9780",
        pathRewrite: { "^/api": "" },
      },
    },
  },
  // jsx options direct set to esbuild
  jsxFactory: "React.createElement",
  jsxFragment: "React.Fragment",
};

Acknowledgment

raulanatol / template-ts-package

License

The MIT License (MIT)

About

License:MIT License


Languages

Language:TypeScript 83.2%Language:JavaScript 13.3%Language:Shell 1.6%Language:SCSS 0.7%Language:HTML 0.6%Language:Makefile 0.6%