Micro Ts screenshot

Micro Ts

Author Avatar Theme by Adevinwild
Updated: 22 Feb 2023
87 Stars

A minimalist template to create packages with TypeScript and microbundle from @developit

Categories

Overview

This product is a pre-configured microbundle repository that provides various features for developing and publishing NPM packages. It includes eslint and prettier for code formatting, jest and ts-jest for testing, and a guide for publishing packages using the np package. The repository is based on the microbundle package and provides different file formats for targeting different environments.

Features

  • Pre-configured microbundle repository: The repository is already set up with microbundle, making it easy to build NPM packages.
  • Pre-configured eslint and prettier: eslint and prettier are included for code formatting and maintaining code quality.
  • Pre-configured jest and ts-jest: Jest and ts-jest are provided for unit testing and TypeScript support.

Installation

To use this template:

  1. Clone the repository or click on the “Use this template” button to create a new repository from this template.
  2. Start working inside the src folder.
  3. Run npm run build to build the package.

Publishing

While the package doesn’t include a specific package for publishing, the recommendation is to use the np package. The np package provides a simple and straightforward method for publishing NPM packages. Use the following command to guide you through the publishing process:

np

Configuration

This repository is based on the microbundle package. For more information about the configuration, refer to the microbundle documentation. The package.json file in this repository contains various keys related to the microbundle configuration.

When building your project using microbundle, three different file formats are generated:

  • .umd.js: Universal Module Definition (UMD) file format that works in different module systems.
  • .module.js: ES module file format designed to work in modern browsers and build tools.
  • .cjs: CommonJS module file format used in Node.js and older JavaScript environments.

You can use these file formats to target different environments.

License

This product is licensed under MIT.