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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@websaam/nx-esbuild

v0.0.1

Published

- https://github.com/sevenwestmedia-labs/nx-plugins - https://github.com/sevenwestmedia-labs/nx-plugins/tree/main/libs/nx-esbuild

Downloads

53

Readme

This repo forked from @wanews/nx-esbuild

  • https://github.com/sevenwestmedia-labs/nx-plugins
  • https://github.com/sevenwestmedia-labs/nx-plugins/tree/main/libs/nx-esbuild

Changes made:

  • Extracted the nx-esbuild from the nx-plugin monorepo
  • Modified the plugins schema to accept an extra argument function : string
  • Added the ability to specify the constant name to execute eg:

// BEFORE: in the esbuild config file 

const { nodeBuiltIns } = require("esbuild-node-builtins");

require('esbuild').build({
    ...
    plugins: [nodeBuiltIns()],
    ...
});

// NOW: in the project.json file
"buildPackage":{
    "executor": "@websaam/nx-esbuild:package",
    "options":{
        "plugins":[
          {
            "package": "esbuild-node-builtins",
            "function": "nodeBuiltIns"
          }
        ]
    }
}

nx-esbuild

NX Plugin to build your node apps using ESBuild and can serve it by watching the bundle with nodemon

Generators

node

Creates a new node application.

  • dependencies in package.json will automatically get marked as externals

Executors

build

Bundles your node application

Options

The available options are listed in libs/nx-esbuild/src/executors/build/schema.json

See https://esbuild.github.io/api/#simple-options for more info on the available options

package

Primarily designed when bundling lambdas, it will ensure node_modules is installed into dist for each entrypoint, then zips the output folder (ready to be uploaded to AWS)

NOTE: Currently only supports pnpm

Externals & node_modules

If you create a package.json next to the entrypoint, it will be used instead of the project package.json. This is useful when you have a specific lambda have less dependencies installed than the project has. Externals will only ever use the root package.json (so it should always be a superset of the lambda entrypoint package.json)

beforeZip hook

If there is additional preparation you need to do before zipping, you can use the beforeZip hook. It will be run with a CWD of the output folder.

Options

The available options are listed in libs/nx-esbuild/src/executors/build/schema.json

See https://esbuild.github.io/api/#simple-options for more info on the available options

serve

Bundles your node application in watch mode, then starts nodemon to watch the bundle

Options

The available options are listed in llibs/nx-esbuild/src/executors/serve/schema.json

See https://esbuild.github.io/api/#simple-options for more info on the available options

An option is missing

I have just added the options I needed to start with, to add another just

  • Add the option to the schema.json file
  • Add the option to the schema.d.ts file
  • Consume the option in executor.ts and pass the appropriate cli arg