I\'m trying to publish a typescript library on NPM but I can\'t to have a \"good\" path after publishing.
I follow several guide on this point but I\'m not found a solut
On suggestions of @joe-clay, I found a solution.
My new structure is the following:
dist
|- Alls files generated after tsc build
|- package.json
|- LICENSE
|- README.md
src
|- All TS files of library (source)
CHANGELOG.md
LICENSE
README.md
tsconfig.json
The dist
directory is published on NPM with README.md and LICENSE file for NPM package page.
The root directory is the entry point on Github with README.md, LICENSE and CHANGELOG.md for development process on Github.
tsconfig.json
is placed on the root because I don't find a solution to have correct build if located inside dist
directory.
In package.json
, I add the script "build": "cd ../ && tsc"
in order to be able to execute npm run build
inside dist
directory.
With this structure, library development and NPM publishing works fine.
And I can use this import from my application:
import {Component} from '/Component';
Thank you again.