import json from "@rollup/plugin-json"; import terser from "@rollup/plugin-terser"; import { rollupPluginHTML as html } from "@web/rollup-plugin-html"; import zip from "rollup-plugin-zip"; import serve from "rollup-plugin-serve"; import { nodeResolve } from "@rollup/plugin-node-resolve"; import commonjs from "@rollup/plugin-commonjs"; import copy from "rollup-plugin-copy2"; import bundleSize from "./rollup-plugins/bundle-size.mjs"; const zipPlug = zip({ file: "game.zip" }); zipPlug.writeBundle.sequential = true; /** * @type {import('rollup').RollupOptions} */ export default { input: "index.html", output: [ { inlineDynamicImports: true, dir: "dist", format: "iife", }, { inlineDynamicImports: true, dir: "dist/min", format: "iife", name: "version", plugins: [terser(), zipPlug, bundleSize({ file: "game.zip", maxSize: 13 })], }, ], plugins: [ html({ minify: true }), json(), nodeResolve(), commonjs(), copy({ assets: ["assets/*"] }), serve({ contentBase: "dist", port: 9000, verbose: true }), ], };