1.0.0 • Published 3 years ago
miguel-malqui-calculator2 v1.0.0
calculator2
init package and git
git init
npm init -yadd ts as dev dependency
npm install --save-dev typescriptAdd tsconfig.json to compile Typescript
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": true,
"outDir": "./lib",
"strict": true
},
"include": ["src"],
"exclude": ["node_modules", "**/__tests__/*"]
}Add a build script to package.json
"build" : "tsc"code
Create a src folder in the root and add index.ts file.
.gitignore
node_modules
/libinclude only build files in the package
Add the files property in package.json
"files": ["lib/**/*"]Prepare to publish
Add prepare script to package.json. It will run before package is packed and published.
"prepare" : "npm run build"publish
npm publish
1.0.0
3 years ago