Last active
May 7, 2018 06:37
-
-
Save elvinmeza/4aa43cfe743f77287a48593d4544c2cf to your computer and use it in GitHub Desktop.
Publishing a simple Typescript library into npm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export * from './person.model'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "typescript-library-to-publish", | |
"version": "1.0.0", | |
"description": "A simple library to publish as a public package into npm's registry", | |
"main": "dist/index.js", | |
"types": "dist/index.d.ts", | |
"scripts": { | |
"compile": "rimraf dist && tsc" | |
}, | |
"author": "elvinmeza", | |
"devDependencies": { | |
"rimraf": "^2.6.2", | |
"typescript": "^2.8.3" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Person { | |
name: string; | |
age: number; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"target": "es5", | |
"rootDir": "src", | |
"outDir": "dist", | |
"declaration": true | |
}, | |
"compileOnSave": true, | |
"exclude": [ | |
"node_modules", | |
"dist" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment