Yeoman generator to make a minimal Typescript module
First, install Yeoman and generator-minimal-typescript using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-minimal-typescript
Then generate your new project:
mkdir my-package
cd my-package
yo minimal-typescript
produces:
.
├── README.md
├── package.json
├── src
│ └── index.ts
├── tsconfig.json
└── tslint.json
dependencies:
"dependencies": {
"tslib": "latest"
},
"devDependencies": {
"@types/node": "10.5.2",
"ts-node": "latest",
"tslint": "latest",
"typescript": "latest"
},
"scripts": {
"build": "rm -rf lib && tsc"
},
Write your TypeScript code in ./src
Build with npm run build
.ts and .tsx (React) files are compiled to ./lib
as es5
JavaScript, ready to publish to npm.
MIT © Chris Sattinger