From f8855bb0c103eb9be492a6e3a42d4bd2b1abc084 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 27 Nov 2024 10:59:34 +0100 Subject: [PATCH] Replace rollup.config for vite.config --- packages/bbui/rollup.config.js | 32 -------------------------------- packages/bbui/vite.config.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 32 deletions(-) delete mode 100644 packages/bbui/rollup.config.js create mode 100644 packages/bbui/vite.config.js 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, + }, +})