import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';

const __dirname = dirname(fileURLToPath(import.meta.url));

export default {
  build: {
    lib: {
      entry: resolve(__dirname, 'editor-bundle-entry.js'),
      name: 'toastui',
      fileName: 'toastui-editor-bundle',
      formats: ['iife'],
    },
    outDir: resolve(__dirname, '../src/frontend/vendor/toast-ui'),
    emptyOutDir: false,
    rollupOptions: {
      output: {
        assetFileNames: 'toastui-editor-bundle.[ext]',
      },
    },
  },
};
