import { defineBuildConfig, BuildEntry } from 'unbuild';

const pattern = ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.png', '!**/*.stories.js', '!**/demo', '**/*.svg'];

const shared: BuildEntry = {
  builder: 'mkdist',
  input: './src',
  pattern,
  ext: 'js',
  esbuild: {
    jsx: 'automatic',
  },
  declaration: true,
};
export default defineBuildConfig({
  failOnWarn: false,
  entries: [
    {
      ...shared,
      outDir: './lib',
      format: 'esm',
    },
  ],
});
