Registry / devops / chatbot-react-rollup

chatbot-react-rollup

JSON →
library0.1.10jsnpmunverified

A boilerplate/template for creating modern React libraries using Rollup as the bundler, version 0.1.10. It supports CommonJS and ES module formats, TypeScript, CSS/SASS, Storybook, Jest with React Testing Library, and automatically externalizes peer dependencies. Key differentiators include built-in support for complex peer dependencies like Ant Design, and a focus on learning Rollup configuration. The package is not actively maintained (last update April 2023) and serves primarily as a starter kit rather than a production-ready library.

npm install chatbot-react-rollup
INSTALL
IMPORT
SIG · CHATBOT-REACT-ROLL
C
chatbot-react-rollup
devopsjavascriptv0.1.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

default
✓ import MyComponent from 'my-library'
✗ const MyComponent = require('my-library')
ESM-only; package.json exports prefer ES module entry. CommonJS require may not work or require .default.
{ Button }
✓ import { Button } from 'my-library'
✗ import Button from 'my-library'
Named exports available; verify actual exports in your library's index.
type Props
✓ import type { Props } from 'my-library'
Use `import type` for type-only exports to avoid bundling issues. Only if types are exported.
{ ButtonProps }
✓ import { ButtonProps } from 'my-library'
✗ import type { ButtonProps } from 'my-library'
ButtonProps is a type; use `import { ButtonProps }` if it's a runtime export, or `import type { ButtonProps }` if only a type. Check the library's export.

Cloning the template, installing peer dependencies, running Storybook for development, and building the library for production.

// Clone the template and install dependencies git clone https://github.com/Angelus123/rollup-react-library-starter.git my-react-library cd my-react-library npm install // Start Storybook in development mode to see components npm run storybook // In another terminal, watch for changes and rebuild npm run dev // Build for production npm run build // Run tests npm test
Debug
Known issues
deprecatedTerser plugin uses @rollup/plugin-terser which may have breaking changes in version 6.
fix
If updating rollup plugins, check compatibility. Use lockfile to stay on tested versions.
affects: >=0.1.0
gotchaPeer dependency 'antd' is bundled as external, but its CSS may need separate handling. The template does not include antd CSS in the output.
fix
Users of the library must import antd CSS globally in their app: import 'antd/dist/reset.css' (v5).
affects: >=0.1.0
gotchaIf you replace antd with another UI library, ensure rollup-plugin-peer-deps-external handles it correctly. The template's rollup config is tied to antd as an example.
fix
Update the rollup.config.js to externalize your chosen dependencies and adjust any CSS imports.
affects: >=0.1.0
deprecatedTemplate is based on create-react-library which is no longer maintained. This template is also not actively maintained (last update April 2023).
fix
Consider using up-to-date alternatives like tsup, tsdx, or microbundle.
affects: >=0.1.0
gotchaNode.js version compatibility: Rollup and plugins may require Node >=14. The template does not specify engine requirements.
fix
Use Node.js 16 or 18 for best compatibility. Check rollup docs for Node version support.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Could not resolve 'antd'
Ant Design is a peer dependency but not installed in the consuming project.
fix
Run `npm install antd` in the host app. The library expects antd to be available externally.
Module not found: Can't resolve 'react'
React is not installed as a dependency in the host project.
fix
Add react and react-dom as dependencies: `npm install react react-dom`.
SyntaxError: Unexpected token 'export'
The consuming project uses CommonJS (require) and has not configured ESM interop.
fix
Use `import` syntax or configure bundler (e.g., webpack) to handle ES modules. If using Node.js, add 'type': 'module' to package.json.
Error: Cannot find module 'rollup-plugin-peer-deps-external'
The template's devDependencies include that package, but it may not be installed if not running `npm install`.
fix
Ensure `npm install` is run in the library project before building.
Upgrade
Version history
0.1.10latest on npm
Audit
Dependencies
reactrequiredPeer dependency: required to use React components. Must be >=16.8.0.
react-domrequiredPeer dependency: required for DOM rendering. Must be >=16.8.0.
antdoptionalPeer dependency: example UI library. Can be replaced with other peer dependencies. Must be ^5.4.0.
Agent activity
5 hits · last 30 days
node
4
Resources
chatbot-react-rollup — npm install chatbot-react-rollup · libregistry