Replace rollup.config for vite.config
This commit is contained in:
parent
9982b5d907
commit
f8855bb0c1
|
@ -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(),
|
||||
],
|
||||
}
|
|
@ -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,
|
||||
},
|
||||
})
|
Loading…
Reference in New Issue