DEV Community

Discussion on: I'm going to give Snowpack a try now ️📦

Collapse
 
crimsonmed profile image
Médéric Burlet

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:

GitHub logo 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:

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

private: true,

To publish a patch

yarn patch

To publish a minor

yarn minor

To publish a major

yarn major



Here is the explanatory article:

Collapse
 
thormeier profile image
Pascal Thormeier

That's looks very useful! Noted for future projects, thank you so much for sharing :)