Asto JavaScript/TypeScript Bundler

0.1.0 · active · verified Tue Apr 21

Asto is a minimalist JavaScript and TypeScript package bundler designed for small bundle sizes, claiming to be only 9kb. As of version `0.1.0`, it provides core bundling capabilities with built-in TypeScript support and an extendable loader architecture. It defaults to using `esbuild` for performance but also offers an optional Webpack loader for scenarios requiring more advanced or stable bundling features typically associated with Webpack. The package is currently in its very early stages of development, indicated by its `0.1.0` version, suggesting an active but potentially rapidly evolving API and feature set. Its primary differentiation lies in its small footprint and focus on simplicity, making it a lightweight alternative for projects that don't require the full complexity of larger bundlers. Release cadence is currently irregular given its early stage.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to configure Asto with the optional Webpack loader for TypeScript projects, bundling multiple entry points and handling assets with specified Webpack options.

import { asto } from 'asto';
import { webpackLoader } from '@asto/webpack';

// Install @asto/webpack and webpack first: npm i -D @asto/webpack webpack

asto({
  loader: webpackLoader(
    {
      typescript: true, // Enable TypeScript processing
      nodeExternals: true, // Exclude node_modules from the bundle
    },
    {
      // Additional webpack options can go here, e.g., output configuration
      output: {
        filename: '[name].js',
        path: new URL('./dist', import.meta.url).pathname,
      },
    }
  ),
  entryPoints: [
    'src/index.ts', // Your primary application entry point
    {
      input: 'assets/image.png',
      output: 'dist/assets/image.png',
      builder: 'asset',
    },
  ],
}).then(() => {
  console.log('Asto bundling complete with Webpack loader.');
}).catch(err => {
  console.error('Asto bundling failed:', err);
});

view raw JSON →