/esbuild-demo

esbuild demo

Primary LanguageJavaScript

esbuild-demo

https://esbuild.github.io

Goals

  • Use latest ES features
  • Separated into module files
  • Bundled for browser
  • Compiles to older ES version targets
  • Tree shaking
  • Minification
  • Sourcemap creation
  • Does not import library dependencies - TODO
  • Can use in "watch" mode
  • Support Typescript - TODO
  • Support JSX / React

ECMAScript versions to browser targets

The iife format will automatically be enabled when no output format is specified, bundling is enabled, and platform is set to browser (which it is by default)

npx esbuild area.js --bundle --outfile=area.min.js --target=es2018 --global-name=charts

npx esbuild area.js --bundle --minify --sourcemap --outfile=area.min.js --target=es2018 --global-name=charts

Watch

https://esbuild.github.io/api/#watch