In this boilerplate we have a simple look at a very basic typescript package exported for the web.
We leverage the use of webpack to expose our package to the browser.
Installation
install the dev packages with yarn:
yarn
Developement
yarn start
This will start webpack to compile the library on changes.
This will also start snowpack which will update the index.html in test once the library from webpack has been compiled
Build
yarn build
Publish Package
First login to the npm cli if not already done
npm login
You will need to remove the following line in your package.json
Passionate full stack web developer, course author for Educative, book author for Packt, he/him.
Find my work and get to know me on my Linktree: https://linktr.ee/thormeier
Discovered it a while back randomly and fell in love with it. It is so blazing fast.
We made a simple template for creating web packages with it:
pixiumdigital / typescript-package-boilerplate
webpack package with typescript support
Typescript Webpackage Boilerplate
In this boilerplate we have a simple look at a very basic typescript package exported for the web.
We leverage the use of webpack to expose our package to the browser.
Installation
install the dev packages with yarn:
Developement
This will start webpack to compile the library on changes. This will also start snowpack which will update the index.html in test once the library from webpack has been compiled
Build
Publish Package
First login to the npm cli if not already done
You will need to remove the following line in your
package.json
To publish a patch
To publish a minor
To publish a major
Here is the explanatory article:
🔨 Build a web package with typescript! 🔥
Médéric Burlet ・ Nov 27 '20 ・ 3 min read
That's looks very useful! Noted for future projects, thank you so much for sharing :)