npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@2forweb/simple-build

v1.0.7

Published

Simple build system based in ESBuild

Downloads

252

Readme

simple-build

Version Lint TypeCheck Build Tests

Simple build system taking on ESBuild and standardizing a few things.

Summary

The objective of this project is to provide a simple abstraction on top pf esbuild to provide a few standard configurations that can be used to build the front end aspect of symfony or similar web applications.

While this was created with symfony and asset mapper in mind, it can be used in other environments.

Basics and examples

Source and outputs

The system is based on the concept of a source client folder and an output folder where the files will be placed.

With the intention not to pollute the ./assets folder for asset mapper, the system uses the ./client folder as the source folder for scss and typescript files.

All paths you provide later to the different build tasks will be relative to these client and assets folders. But you can circumvent this by providing relative paths, such as ../public/static/js/out.js. This will be calculated from ./assets and will correctly point to the project's ./public folder.

Environment

The system uses the APP_ENV environment variable to determine the presence or absence of source maps. This can be configured in .env or .env.local files or as environment variables.

Watch

If you pass the parameter watch to your build script, the system will automatically watch for changes in the client folder.

Example build file

Write a js build file on the root of your application like this:

import { build, BuildTypeScript, BuildScss } from '@2forweb/simple-build';
import * as path from 'path';

await build({
    clientRoot: path.resolve(__dirname, './client'),
    assetRoot: path.resolve(__dirname, './assets'),
    buildTasks: [
        {
            name: 'TypeScript controller',
            task: BuildTypeScript,
            entry: {
                tsconfigPath: ['./controllers/tsconfig.json'],
            },
        },
        {
            name: 'Sass',
            task: BuildScss,
            entry: {
                entryPoints: ['./styles/app.scss'],
                outFile: 'app.css',
            },
        },
    ],
});

This will use tsc to typecheck and build the typescript files in the ./client/controllers folder as specified by your tsconfig.json file and sass to build the ./client/styles/app.scss and place it under ./assets/app.css, ready for Asset Mapper to pick it up.

The next step would be to add these scripts to your package.json file:

{
    "scripts": {
        "build": "node ./build.js",
        "build:watch": "node ./build.js watch"
    }
}

Tasks

BuildTask

Generic esbuild build task using entry points and an outDir or outFile parameters. This will determine weather to bundle or to place all the files in the directory specified.

BuildScss

A build task designed to build scss files.

CopyFiles

This will use the copy-files-plugin to copy different assets to the ./assets folder.

BuildTypeScript

A build task designed to build typescript files using a tsconfig.json configuration file.

Entry

The entry (as a property in the buildTasks array) is the simplified esbuild configuration object. An esbuild config object will be created from this with all paths resolved to their client or assets directories.

entryPoints

An array of entry points to be built.

outFile

The file to be created. If this is set the bundle property will be set to true.

outDir

The directory to place the files in. If this is set the bundle property will be set to false and all files listed in the entry points will be converted one by one.

tsconfigPath

For the BuildTypeScript task, this is the path to the tsconfig.json that will be used to build the files. This is also useful to perform type checking or creating a set of definition files.

cleanPatterns

An array of glob patterns to clean before building. If this is passed, the clean-files-plugin will be used to clean the files before building.

plugins

An array of additional esbuild plugins to run on the build task. These can be useful for example, to resolve external fonts or image paths in a scss file.