@nl-design-system/rollup-config-react-component

1.0.3 • Public • Published

@nl-design-system/rollup-config-react-component

A shareable Rollup configuration for React components.

Installation

Using npm:

npm install --save-dev @nl-design-system/rollup-config-react-component rollup

Using yarn:

yarn add --save-dev @nl-design-system/rollup-config-react-component rollup

Using pnpm:

pnpm add --save-dev @nl-design-system/rollup-config-react-component rollup

Usage

In your rollup.config.mjs, you only need to extend @nl-design-system/rollup-config-react-component with entry points as follows:

import { config } from '@nl-design-system/rollup-config-react-component';
import { defineConfig } from 'rollup';

export default defineConfig({
  input: ['path/to/file', /* more entry points */],
  ...config;
});

To build a React component, the option "composite" in a tsconfig.json's "compilerOptions" has to be false. Therefore this configuration explicitly uses a tsconfig.build.json:

{
  "extends": ["./tsconfig.json"],
  "compilerOptions": {
    "composite": false,
    // other build options
  },
  "exclude": ["**/*.test.ts", "**/*.test.tsx"],
}

Readme

Keywords

none

Package Sidebar

Install

npm i @nl-design-system/rollup-config-react-component

Weekly Downloads

70

Version

1.0.3

License

EUPL-1.2

Unpacked Size

16.9 kB

Total Files

4

Last publish

Collaborators

  • nl-design-system-ci
  • littlebobbytabl.es
  • yolijn