You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
893 B
40 lines
893 B
import babel from '@rollup/plugin-babel'; |
|
import commonjs from '@rollup/plugin-commonjs'; |
|
import peerDepsExternal from 'rollup-plugin-peer-deps-external'; |
|
import resolve from '@rollup/plugin-node-resolve'; |
|
import { terser } from 'rollup-plugin-terser'; |
|
|
|
const packageJson = require('./package.json'); |
|
|
|
const config = { |
|
extensions: ['.ts', '.tsx'], |
|
}; |
|
|
|
export default { |
|
input: 'src/index.ts', |
|
output: [ |
|
{ |
|
file: packageJson.main, |
|
format: 'cjs', |
|
sourcemap: true, |
|
plugins: [terser()], |
|
}, |
|
{ |
|
file: packageJson.module, |
|
format: 'esm', |
|
sourcemap: true, |
|
plugins: [terser()], |
|
}, |
|
], |
|
external: ['react'], |
|
plugins: [ |
|
peerDepsExternal(), |
|
resolve({ extensions: config.extensions }), |
|
commonjs(), |
|
babel({ |
|
extensions: config.extensions, |
|
include: ['src/**'], |
|
exclude: 'node_modules/**', |
|
}), |
|
], |
|
};
|
|
|