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-assetsVerified import paths — ran on the pinned version, not inferred.
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.
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.
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.
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.
Always test builds thoroughly. Ensure your version of the fork incorporates upstream fixes for annotation processing and specific Babel plugin behaviors.
Use `amdName` in `package.json` or `--name <your-name>` for specific UMD global naming, or `amdName: "global.yourLib"` for extending existing globals.
Change `"module": "dist/index.js"` to `"module": "dist/index.mjs"` in your `package.json` to comply with the new naming convention.
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.
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.
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.
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.
No dependency data recorded yet.