import { build } from 'vite';
import plugin from './plugin/build.js';

const main = async ({
  config: configFile,
  reload,
  root,
  mode = "preview",
  logLevel,
  clearScreen,
  base,
  outDir,
  ...preview
}) => {
  const config = {
    root,
    logLevel,
    clearScreen,
    mode,
    base,
    build: { outDir, watch: {} },
    preview
  };
  await build({
    ...config,
    configFile,
    plugins: [
      plugin({ reload, config })
    ]
  });
};

export { main };
//# sourceMappingURL=main.js.map
