Registry / devops / microbundle-crl-with-assets

microbundle-crl-with-assets

JSON →
library0.13.12jsnpmunverified

This package, `microbundle-crl-with-assets`, is a specialized fork of the zero-configuration JavaScript bundler, Microbundle, tailored for use with `create-react-library`. Its primary function is to bundle tiny JavaScript libraries efficiently using Rollup, offering features like ESnext and async/await support, multiple entry modules, and various output formats (CJS, UMD, ESM) with built-in Terser compression. This particular fork, currently at version 0.13.12, includes specific enhancements for React development, such as defaulting JSX to `React.createElement`, smart bundling of image assets via `rollup-plugin-smart-asset`, and support for legacy decorators (`@babel/plugin-proposal-decorators`) and optional chaining (`@babel/plugin-proposal-optional-chaining`). The release cadence for this fork is dependent on both upstream Microbundle updates and specific feature additions for `create-react-library`. Its key differentiator lies in its React-focused default configurations and asset handling, making it a convenient solution for React library authors.

npm install microbundle-crl-with-assets
INSTALL
IMPORT
SIG · MICROBUNDLE-CRL-WI
M
microbundle-crl-with-assets
devopsjavascriptv0.13.12
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

microbundle-crl-with-assets
// In package.json scripts: "scripts": { "build": "microbundle-crl-with-assets" }
import microbundle from 'microbundle-crl-with-assets';
`microbundle-crl-with-assets` is primarily a CLI tool and not intended for direct programmatic import as a JavaScript module. Its executable is found via `npx` or `package.json` scripts after installation.
microbundle-crl-with-assets watch
// In package.json scripts: "scripts": { "dev": "microbundle-crl-with-assets watch" }
import { watch } from 'microbundle-crl-with-assets';
This command initiates a file watcher for development, automatically rebuilding on source file changes.
microbundle-crl-with-assets -f modern,umd
// In package.json scripts: "scripts": { "build:modern": "microbundle-crl-with-assets -f modern,umd" }
import { build } from 'microbundle-crl-with-assets/formats';
Command-line flags like `-f` (for output formats) or `--workers` are passed directly to the `microbundle-crl-with-assets` CLI executable.

This `package.json` configuration demonstrates how to set up `microbundle-crl-with-assets` for a library. It defines source and output paths for CommonJS, ES Modules, and UMD formats, along with `build` and `dev` scripts to compile and watch the library.

{ "name": "my-awesome-lib", "version": "1.0.0", "source": "src/index.js", "main": "dist/index.js", "module": "dist/index.mjs", "unpkg": "dist/index.umd.js", "scripts": { "build": "microbundle-crl-with-assets", "dev": "microbundle-crl-with-assets watch" } }
microbundle --version
Debug
Known issues
gotchaThis package (`microbundle-crl-with-assets`) is a custom fork of the upstream `developit/microbundle` package. It includes specific modifications for React and asset handling, which may differ from the official `microbundle` behavior.
fix
Be aware of the specific features and potential divergences from the main `microbundle` project. Refer to the fork's README for its unique functionalities and ensure it meets your specific React-focused bundling needs.
affects: >=0.13.0
breakingFor packages with `type: "commonjs"` in `package.json`, ESM output files (like those for the `module` field) now default to using the `.mjs` extension instead of `.js`. This change was introduced in upstream `microbundle` v0.15.0.
fix
Update your `package.json` `module` field to point to an `.mjs` file extension (e.g., `"module": "dist/foo.mjs"`) if your package is CJS and you output ESM.
affects: >=0.15.0 (upstream `microbundle` equivalent)
gotchaEarlier versions of upstream `microbundle` (prior to v0.15.1) had a bug where if multiple entry files referenced different CSS, only the CSS referenced by the *first* entry file would be packaged, potentially leading to missing styles.
fix
Update `microbundle-crl-with-assets` to a version that includes the fix for [#961](https://github.com/developit/microbundle/pull/961) (equivalent to upstream v0.15.1 or later). Manually ensure all necessary CSS is included in affected older versions.
affects: <0.15.1 (upstream `microbundle` equivalent)
gotchaRelying on specific internal behaviors of Babel or Terser annotations without explicit support may lead to unexpected behavior. For example, Terser annotations like `/*@__NOINLINE__*/` were incorrectly removed in some upstream `microbundle` versions (prior to v0.13.3).
fix
Always test builds thoroughly. Ensure your version of the fork incorporates upstream fixes for annotation processing and specific Babel plugin behaviors.
affects: <0.13.3 (upstream `microbundle` equivalent)
gotchaWhen defining a UMD global name, the `amdName` field in `package.json` or the `--name` CLI flag can be used to override the default snake-cased `name`. You can also extend an existing UMD global by prefixing `amdName` (e.g., `"global.xyz"`).
fix
Use `amdName` in `package.json` or `--name <your-name>` for specific UMD global naming, or `amdName: "global.yourLib"` for extending existing globals.
affects: *
Errors
Common errors & fixes
ESM output files are expected to use the .mjs extension for CJS packages. Please update your package.json module field.
The `module` field in `package.json` points to a `.js` file for ESM output, but the package `type` is `commonjs`, and Microbundle (v0.15.0+ upstream) now enforces `.mjs` for this scenario.
fix
Change `"module": "dist/index.js"` to `"module": "dist/index.mjs"` in your `package.json` to comply with the new naming convention.
ReferenceError: React is not defined
JSX output is attempting to use `React.createElement` (the default for this fork) but React is not globally available or correctly imported/configured in the consuming environment.
fix
Ensure React is available in the consuming environment. If not using React, consider configuring a different `jsxFactory` if the fork provides an option, or use the upstream `microbundle` for non-React projects.
Assets are not being bundled or appear as [object Object] in the output.
The `rollup-plugin-smart-asset` integration specific to this fork might not be correctly configured, assets are not being imported in a way it recognizes, or there's a bug in the asset bundling process.
fix
Verify asset import paths and ensure your assets are of types supported by `rollup-plugin-smart-asset`. Update `microbundle-crl-with-assets` to the latest version to obtain bug fixes related to asset handling.
SyntaxError: Unexpected token '?'
Attempting to use modern JavaScript syntax like optional chaining (`?.`) or nullish coalescing (`??`) in an environment that doesn't support it, and the bundler has not transpiled it correctly for the target.
fix
This fork includes `@babel/plugin-proposal-optional-chaining`. Ensure your `microbundle-crl-with-assets` version is up-to-date. If issues persist, verify `browserslist` configuration if it's being respected, or target a less 'modern' output if available.
Error: [!] Error: Could not resolve entry module (module name)
The `source` field in `package.json` or the input path provided to the `microbundle-crl-with-assets` CLI does not correctly point to an existing entry file.
fix
Double-check the `source` field in your `package.json` or the command-line argument for the entry file path. Ensure the file exists and the path is correct relative to your project root.
Upgrade
Version history
0.13.12latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources