Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.25 KB

File metadata and controls

45 lines (31 loc) · 1.25 KB

ESBUILD

DESCRIPTION

EXAMPLES AND INSTRUCTIONS TO CONFIGURE:

  • ESBUILD: A FAST TYPESCRIPT TO JAVASCRIPT TRANSPILER AND BUNDLER.

PREREQUISITES

  • NODEMON: FOLLOW THE INSTRUCTIONS HERE.

REQUIRED PACKAGES

npm install -D esbuild
npm install -D esbuild-node-tsc
npm install -D cpy
npm install -D rimraf

CONFIGURATION

  • ADD folderBundle to .gitignore.

  • CREATE FILE esbuild.development.config.js.

  • CREATE FILE esbuild.production.config.js.

  • CREATE COMMAND npm run esbuild-nodemon BY ADDING THE FOLLOWING LINES TO THE script ENTRY IN package.json:

    "esbuild-nodemon": "nodemon --exec \"esbuild-node-tsc --config=esbuild.development.config.js && node %npm_config_jsfile%\"",

EXAMPLE WITH ESBUILD AND NODEMON ON DEVELOPMENT MODE

npm run esbuild-nodemon --jsfile=./folderDist/folderTopics/folderEsbuild/exampleEsbuild.js

EXAMPLE WITH ESBUILD ON PRODUCTION MODE

# BUNDLE WITH ESBUILD AND RUN ON PRODUCTION MODE 
node ./folderSource/folderTopics/folderEsbuild/esbuild.production.config.js # THIS IS GOING TO CREATE/BUNDLE ./folderBundle/exampleEsbuild.js
node ./folderBundle/exampleEsbuild.js