Coder Social home page Coder Social logo

esbuild-server's Introduction

ESBuild Server

A fast dev-server and storybook built with esbuild.

Getting started

To run the dev server with the examples:

yarn build

cd examples
../bin/main.js dev 

To run the storybook within the examples:

cd examples
../bin/main.js book stories/*.stories.tsx

CLI reference

Run esbuild-server --help or esbuild-server <command> --help for an always up-to-date CLI reference.

Running apps and storybooks

esbuild-server <command>

Commands:
  esbuild-server build              Build the app for production.
  esbuild-server dev                Start the dev server.
  esbuild-server book [stories...]  Start the dev server with a book of components.

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

Building storybooks

esbuild-server book --build [stories...]

Config file

Config is automatically loaded from ./esbuild-server.config.js.

export interface Config {
  /**
   * List of entry points to bundle.
   *
   * Those are then can be requested from the dev server.
   *
   * Read more: https://esbuild.github.io/api/#entry-points
   */
  entryPoints?: string[] | Record<string, string>

  /**
   * Directory to output production build to.
   */
  outdir?: string

  /**
   * Override esapp default settings for esbuild
   */
  overrides?: BuildOptions

  /**
   * Directory with static files to be served by the dev server.
   */
  staticDir?: string

  /**
   * Esbuild plugins: https://esbuild.github.io/plugins/.
   */
  plugins?: Plugin[]
}

Storybook

esbuild-server stories are compatible with storybook format, although only the very minimal features are supported.

To render a storybook run the following command (replacing with your glob for stories).

esbuild-server book 'stories/**/*.stories.tsx'

Each story file should export a set of components and optionally a default export with the title that will be displayed in the outline.

Development

Use yarn link and yarn build --watch to use the development build of this project from another package.

Polyfills

Currently esbuild-server does not polyfill any of the node.js modules or globals. If your code is using them you'd need to manually include a plugin to add them.

esbuild-server's People

Contributors

dmaretskyi avatar richburdon avatar rzadp avatar wittjosiah avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.