Some checks failed
E2E Playwright - Studio Panel / playwright-e2e (push) Has been cancelled
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
|
|
import resolve from '@rollup/plugin-node-resolve';
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
import typescript from '@rollup/plugin-typescript';
|
|
import postcss from 'rollup-plugin-postcss';
|
|
import copy from 'rollup-plugin-copy';
|
|
|
|
export default {
|
|
input: 'src/index.ts',
|
|
output: [
|
|
{
|
|
file: 'dist/index.cjs.js',
|
|
format: 'cjs',
|
|
sourcemap: true,
|
|
},
|
|
{
|
|
file: 'dist/index.esm.js',
|
|
format: 'es',
|
|
sourcemap: true,
|
|
},
|
|
],
|
|
plugins: [
|
|
peerDepsExternal(),
|
|
resolve({ extensions: ['.js', '.ts', '.tsx'] }),
|
|
commonjs(),
|
|
typescript({ tsconfig: './tsconfig.json' }),
|
|
postcss({ extract: true, minimize: true }),
|
|
// copy CSS module files and global styles to dist so relative @import paths resolve
|
|
copy({
|
|
targets: [
|
|
{ src: 'src/components/**/*.module.css', dest: 'dist/components' },
|
|
{ src: 'src/styles/**/*.css', dest: 'dist/styles' }
|
|
],
|
|
verbose: true,
|
|
flatten: false,
|
|
}),
|
|
],
|
|
};
|