- Node.js version
>= 16.16.
yarn buildRemove dist directory before bundle files.
yarn build --cleanRun script with --playground flag will only build files needed for the website.
yarn build --playgroundTo print the bundled file sizes:
yarn build --print-sizePrint the file size changes compare to the last released version:
yarn build --compare-sizeTo build specific file(s):
yarn build --file=esm/parser-babel.mjsyarn build --file=standalone.js --file=parser-meriyah.jsTo save bundled file to a different location, this flag can only use together with ONE --file flag
yarn build --file=parser-babel.js --save-as=babel-for-test.jsVisualize and analyze your esbuild bundle to see which modules are taking up space.
Available reporter formats:
htmlGenerate a HTML report file, saved next to the bundled file with.report.htmlsuffix.textGenerate a plain text report file, saved next to the bundled file with.report.txtsuffix.stdoutLog report information in console.
yarn build --report=all
yarn build --report=stdout --report=text --report=htmlBy default, the file minification is controlled by config.mjs and bundler.mjs, these flags are added to override that behavior.
These should only be used for debugging purposes, suggest to use them together with the --file flag.
Force minify files:
yarn build --file=index.js --minifyDisable minify files:
yarn build --file=parser-babel.js --no-minify