2021-03-31 17:14:56 +02:00
|
|
|
import svelte from "@sveltejs/vite-plugin-svelte"
|
|
|
|
const path = require("path")
|
|
|
|
|
|
|
|
export default ({ mode }) => {
|
|
|
|
const isProduction = mode === "production"
|
|
|
|
return {
|
|
|
|
build: {
|
|
|
|
lib: {
|
|
|
|
entry: path.resolve(__dirname, "src/index.js"),
|
|
|
|
name: "standard-components",
|
|
|
|
formats: ["es"],
|
|
|
|
},
|
|
|
|
minify: isProduction,
|
|
|
|
},
|
2021-04-16 17:00:10 +02:00
|
|
|
plugins: [
|
|
|
|
svelte({
|
|
|
|
hot: !isProduction,
|
|
|
|
emitCss: true,
|
|
|
|
}),
|
|
|
|
],
|
2021-03-31 17:14:56 +02:00
|
|
|
resolve: {
|
|
|
|
dedupe: ["svelte", "svelte/internal"],
|
|
|
|
},
|
|
|
|
rollupOptions: {
|
|
|
|
external: ["svelte", "svelte/internal"],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|