2022-01-10 18:41:53 +03:00
|
|
|
import typescript from 'rollup-plugin-typescript2';
|
|
|
|
import resolve from '@rollup/plugin-node-resolve';
|
|
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
|
|
import babel from '@rollup/plugin-babel';
|
|
|
|
import { terser } from 'rollup-plugin-terser';
|
|
|
|
|
|
|
|
const config = [
|
|
|
|
{
|
|
|
|
input: 'src/index.tsx',
|
|
|
|
output: {
|
|
|
|
name: 'ReactJsonTree',
|
2022-01-24 05:11:46 +03:00
|
|
|
file: 'lib/umd/react-json-tree.js',
|
2022-01-10 18:41:53 +03:00
|
|
|
format: 'umd',
|
|
|
|
globals: {
|
|
|
|
react: 'React',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: [
|
2022-01-24 05:11:46 +03:00
|
|
|
typescript({
|
|
|
|
tsconfigOverride: { compilerOptions: { declaration: false } },
|
|
|
|
}),
|
2022-01-10 18:41:53 +03:00
|
|
|
resolve(),
|
|
|
|
commonjs(),
|
|
|
|
babel({
|
|
|
|
babelHelpers: 'runtime',
|
|
|
|
extensions: ['.ts', '.tsx'],
|
|
|
|
plugins: ['@babel/plugin-transform-runtime'],
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
external: ['react'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
input: 'src/index.tsx',
|
|
|
|
output: {
|
|
|
|
name: 'ReactJsonTree',
|
2022-01-24 05:11:46 +03:00
|
|
|
file: 'lib/umd/react-json-tree.min.js',
|
2022-01-10 18:41:53 +03:00
|
|
|
format: 'umd',
|
|
|
|
globals: {
|
|
|
|
react: 'React',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: [
|
2022-01-24 05:11:46 +03:00
|
|
|
typescript({
|
|
|
|
tsconfigOverride: { compilerOptions: { declaration: false } },
|
|
|
|
}),
|
2022-01-10 18:41:53 +03:00
|
|
|
resolve(),
|
|
|
|
commonjs(),
|
|
|
|
babel({
|
|
|
|
babelHelpers: 'runtime',
|
|
|
|
extensions: ['.ts', '.tsx'],
|
|
|
|
plugins: ['@babel/plugin-transform-runtime'],
|
|
|
|
}),
|
|
|
|
terser(),
|
|
|
|
],
|
|
|
|
external: ['react'],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export default config;
|