A Rollup plugin that integrates with the BuckleScript compiler to bundle ReasonML and OCaml code into JavaScript. Version 0.7.0 is the latest stable release (last updated in 2020). It works by running bsb during the build, consuming compiled ES6 modules. Key differentiators include minimal configuration (reads bsconfig.json), support for in-source builds, and options to control warnings and standard library inclusion. Compared to webpack's bs-loader, it fits the Rollup ecosystem better for library authors. Maintenance is intermittent; the repo has low activity.
npm install rollup-plugin-bucklescriptVerified import paths — ran on the pinned version, not inferred.
Shows basic Rollup configuration to compile a ReasonML file (main.re) using the plugin.
Add '"package-specs": ["es6"]' to bsconfig.json.
Check the react example in the repo for workarounds.
Consider using ReScript and its official build tools.
Ensure bs-platform is installed as a devDependency and bsconfig.json is valid.
Run 'npm install --save-dev rollup-plugin-bucklescript'.
Run 'npm install --save-dev bs-platform'.