bruno/packages/bruno-graphql-docs/rollup.config.js

49 lines
1.2 KiB
JavaScript
Raw Normal View History

const { nodeResolve } = require('@rollup/plugin-node-resolve');
const commonjs = require('@rollup/plugin-commonjs');
const typescript = require('@rollup/plugin-typescript');
const dts = require('rollup-plugin-dts');
const postcss = require('rollup-plugin-postcss');
const { terser } = require('rollup-plugin-terser');
const peerDepsExternal = require('rollup-plugin-peer-deps-external');
2022-11-04 19:12:34 +01:00
const packageJson = require('./package.json');
2022-11-04 19:12:34 +01:00
module.exports = [
2022-11-04 19:12:34 +01:00
{
input: 'src/index.ts',
2022-11-04 19:12:34 +01:00
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: true
2022-11-04 19:12:34 +01:00
},
{
file: packageJson.module,
format: 'esm',
sourcemap: true
}
2022-11-04 19:12:34 +01:00
],
plugins: [
postcss({
minimize: true,
extensions: ['.css'],
extract: true
}),
2022-11-04 19:12:34 +01:00
peerDepsExternal(),
nodeResolve({
extensions: ['.css']
}),
2022-11-04 19:12:34 +01:00
commonjs(),
typescript({ tsconfig: './tsconfig.json' }),
terser()
2022-11-04 19:12:34 +01:00
],
external: ['react', 'react-dom', 'index.css']
},
{
input: 'dist/esm/index.d.ts',
external: [/\.css$/],
output: [{ file: 'dist/index.d.ts', format: 'esm' }],
plugins: [dts.default()]
2022-11-04 19:12:34 +01:00
}
];