* Rename `types` to `thirs-party-types` * Copy `index.d.ts` from `@types/prettier` * Make public APIs async * Add missing `formatAST` * Fix `CustomParser` * Fix `Parser.parse` signature * Add comment * Add `standalonw.d.ts` * first implement * Fix path * Add missing parser `.d.ts` * Fix * Fix path * Introduce valid tests * Add unit tests for dts files * Add unit tests * Simplify unit testing * Tweaks structures * Revert needless change * Fix types path * Introduce `ts-expect` * Fix doc utils api * Add AstPath API * Fix API * Fix tests * Fix changelog * Move dts * Update module specifiers * Remove generate dts config file * Update build scripts * Fix type errors * Refactor with namespace imports * Update comments * Fix build script * Improve build script * `typing` -> `types` * Clean up * Minor tweak * Minor tweak * Modify `exports` field * Fix paths in builder * Refactor * Refactor * Address review * Update changelog * Address reviews * Remove `since` from tests * Improve utils type def * Mark deprecated methods * Address review * Move docs types * Address review * Update c8 config * Minor tweak --------- Co-authored-by: fisker Cheung <lionkay@gmail.com>
Prettier Build Script
Requirements
- Node.js version
>= 16.16.
Usage
yarn build
Flags
--clean
Remove dist directory before bundle files.
yarn build --clean
--playground
Run script with --playground flag will only build files needed for the website.
yarn build --playground
--print-size
To print the bundled file sizes:
yarn build --print-size
--compare-size
Print the file size changes compare to the last released version:
yarn build --compare-size
--file
To build specific file(s):
yarn build --file=esm/parser-babel.mjs
yarn build --file=standalone.js --file=parser-meriyah.js
--save-as
To 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.js
--report
Visualize 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
yarn build --report=stdout --report=text --report=html
--report equals to --report=html
--minify and --no-minify
By 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 --minify
Disable minify files:
yarn build --file=parser-babel.js --no-minify