diff --git a/packages/bbui/rollup.config.js b/packages/bbui/rollup.config.js deleted file mode 100644 index da274e0ba5..0000000000 --- a/packages/bbui/rollup.config.js +++ /dev/null @@ -1,32 +0,0 @@ -import svelte from "rollup-plugin-svelte" -import resolve from "@rollup/plugin-node-resolve" -import commonjs from "@rollup/plugin-commonjs" -import json from "@rollup/plugin-json" -import { terser } from "rollup-plugin-terser" -import postcss from "rollup-plugin-postcss" - -export default { - input: "src/index.js", - output: { - sourcemap: true, - format: "esm", - file: "dist/bbui.es.js", - }, - onwarn(warning, warn) { - // suppress eval warnings - if (warning.code === "EVAL") { - return - } - warn(warning) - }, - plugins: [ - resolve(), - commonjs(), - svelte({ - emitCss: true, - }), - postcss(), - terser(), - json(), - ], -} diff --git a/packages/bbui/vite.config.js b/packages/bbui/vite.config.js new file mode 100644 index 0000000000..3d8afe8c07 --- /dev/null +++ b/packages/bbui/vite.config.js @@ -0,0 +1,29 @@ +import { defineConfig } from "vite" +import { svelte } from "@sveltejs/vite-plugin-svelte" +import postcss from "postcss" + +export default defineConfig({ + // https://vite.dev/guide/dep-pre-bundling#monorepos-and-linked-dependencies + optimizeDeps: { + include: ["shared-core"], + }, + build: { + sourcemap: true, + lib: { + entry: "src/index.js", + formats: ["es"], + fileName: "bbui.es", + }, + commonjsOptions: { + include: [/shared-core/, /node_modules/], + }, + }, + plugins: [ + svelte({ + emitCss: true, + }), + ], + css: { + postcss, + }, +})