Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-cosmos-esbuild

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-cosmos-esbuild

Support for esbuild with React Cosmos.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

React Cosmos ESbuild

ESbuild-compatible React Cosmos.

Installation

npm install @adamdickinson/react-cosmos-esbuild

or

yarn add @adamdickinson/react-cosmos-esbuild

Usage

If it's a simple enough build process, you can totally get away with just running:

yarn cosmos-esbuild

Doing so runs cosmos, as well as esbuild with a default, cosmos-compatible config.

However, a lot of esbuild-driven projects have some rather complex requirements, so this package accommodates that too. By specifying a esbuildConfigPath in your cosmos config, you can inject your own esbuild config in to adjust the esbuild config this package uses.

Sample cosmos.config.json:

{
  "esbuildConfigPath": "./scripts/config.js"
}

Sample config.js:

module.exports = {
  define: {
    'process.env.RUNNING_COSMOS', 'true'
  }
}

This config will then be used as the baseline config for the esbuild runner that is used to power cosmos as follows:

{
  ...config,
  bundle: true,
  entryPoints: [MAIN_TS_PATH],
  outfile: MAIN_JS_PATH,
  outdir: undefined
}

In other words, any custom config values for bundle, entryPoints, outfile and outdir will be overridden in order for the package to work with cosmos.

Got some things you'd like to see?

Spin up a PR! Standards are pretty high, but feedback is a cornerstone of any good pull request so expect much love for any contributions.

FAQs

Package last updated on 25 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc