12345678910111213141516171819202122232425262728293031323334353637 |
- import commonjs from 'rollup-plugin-commonjs';
- import resolve from 'rollup-plugin-node-resolve';
- import { terser } from 'rollup-plugin-terser';
- import typescript from 'rollup-plugin-typescript2';
- import postcss from 'rollup-plugin-postcss';
- import babel from '@rollup/plugin-babel';
- export default {
- input: 'src/index.ts',
- output: [
- {
- file: 'dist/library.js',
- format: 'cjs',
- sourcemap: true,
- },
- {
- file: 'dist/library.min.js',
- format: 'cjs',
- sourcemap: true,
- plugins: [terser()],
- },
- ],
- plugins: [
- babel({
- babelHelpers: 'bundled',
- exclude: 'node_modules/**', // Exclude any unnecessary directories
- }),
- resolve(),
- commonjs(),
- typescript({
- tsconfig: 'tsconfig.json',
- allowImportPathExtension: true,
- }),
- postcss()
- ],
- external: ['react', 'react-dom', 'react/jsx-runtime'], // Specify any external dependencies here
- };
|