import terser from '@rollup/plugin-terser';
import resolve from '@rollup/plugin-node-resolve';
import { readFileSync } from 'node:fs';

const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'));
const banner = `/*! ${pkg.name} v${pkg.version} | (c) ${new Date().getUTCFullYear()} sharadtech | Built: ${new Date().toISOString()} */`;

export default {
  input: 'src/index.js',
  output: [
    {
      file: 'dist/infralytiqs-bootstrap.js',
      format: 'iife',
      name: 'InfralytiqsBootstrapPublicisPS',
      sourcemap: false,
      banner,
    },
    {
      file: 'dist/infralytiqs-bootstrap.min.js',
      format: 'iife',
      name: 'InfralytiqsBootstrapPublicisPS',
      sourcemap: false,
      banner,
      plugins: [terser({ format: { comments: /^!/ } })],
    },
  ],
  plugins: [resolve()],
};
