Registry / devops / rollup-plugin-bucklescript

rollup-plugin-bucklescript

JSON →
library0.7.0jsnpmunverified

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-bucklescript
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-BUCK
R
rollup-plugin-bucklescript
devopsjavascriptv0.7.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import bucklescript from 'rollup-plugin-bucklescript'
const bucklescript = require('rollup-plugin-bucklescript')
This package is ESM-only and does not support require(). Use the default import in rollup.config.js which is already ESM.
bucklescript
import bucklescript from 'rollup-plugin-bucklescript'
const { bucklescript } = require('rollup-plugin-bucklescript')
The package exports a single function via default export. Named destructuring will not work.
bucklescript
import bucklescript from 'rollup-plugin-bucklescript'
import { bucklescript } from 'rollup-plugin-bucklescript'
Named import is incorrect. The default export is the plugin function.

Shows basic Rollup configuration to compile a ReasonML file (main.re) using the plugin.

// rollup.config.js import bucklescript from 'rollup-plugin-bucklescript'; export default { input: 'src/main.re', output: { file: 'dist/bundle.js', format: 'cjs' }, plugins: [ bucklescript() ] };
Debug
Known issues
gotchaMust set 'package-specs' in bsconfig.json to 'es6' for Rollup to consume ES modules.
fix
Add '"package-specs": ["es6"]' to bsconfig.json.
affects: >=0.0.0
gotchaIf using ReasonReact, using 'es6' module format can break JSX compilation; follow Rollup error messages to add aliases.
fix
Check the react example in the repo for workarounds.
affects: >=0.0.0
deprecatedBuckleScript is in maintenance mode; the project encourages migration to ReScript.
fix
Consider using ReScript and its official build tools.
affects: >=0.0.0
gotchaPlugin runs bsb during build; bsb must be installed and configured correctly.
fix
Ensure bs-platform is installed as a devDependency and bsconfig.json is valid.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-bucklescript'
Package not installed or not in node_modules.
fix
Run 'npm install --save-dev rollup-plugin-bucklescript'.
Error: [BABEL] unknown: Cannot find module 'bs-platform'
Peer dependency bs-platform is missing.
fix
Run 'npm install --save-dev bs-platform'.
Upgrade
Version history
0.7.0latest on npm
Audit
Dependencies
bs-platformrequiredRequired peer dependency; the actual BuckleScript compiler must be installed separately.
Agent activity
7 hits · last 30 days
node
6
Resources
rollup-plugin-bucklescript — npm install rollup-plugin-bucklescript · libregistry