Running that script in Node.js invokes the esbuild bundler with config parameters from the JavaScript object ( config). This template JavaScript code uses that package to stimulate a JSON configuration file for build parameters. The esbuild library is available an NPM package for Node.js. Developers are expected to use the project build APIs directly. esbuild does not support JSON configuration files for build definitions (unlike webpack or rollup). esbuild configuration scriptĮsbuild can be executed using a CLI tool or through the APIs ( JavaScript and Go). It has source maps generated and typescript type definition files. The compiled code is bundled and minified. This will compile all the source code referenced from the src/index.ts file into a single lib/index.js file. I’ll explain it line by line - but if you just want to get started using it - copy the source code to a JavaScript file ( ) and run node. Automatically exclude all node_modules from the bundled versionĬonst = require( 'esbuild-node-externals')
0 Comments
Leave a Reply. |