budibase/packages/standard-components/rollup.config.js

35 lines
732 B
JavaScript
Raw Normal View History

2020-05-07 23:15:09 +02:00
import commonjs from "@rollup/plugin-commonjs"
import resolve from "@rollup/plugin-node-resolve"
import svelte from "rollup-plugin-svelte"
import postcss from "rollup-plugin-postcss"
import json from "@rollup/plugin-json"
2020-10-12 18:54:18 +02:00
import { terser } from "rollup-plugin-terser"
2019-08-19 22:18:23 +02:00
const production = !process.env.ROLLUP_WATCH
const externals = ["svelte", "svelte/internal"]
2019-08-19 22:18:23 +02:00
export default {
external: externals,
input: "src/index.js",
output: [
{
file: "dist/index.js",
format: "esm",
sourcemap: false,
},
],
plugins: [
production && terser(),
postcss(),
svelte({
dev: !production,
}),
2020-05-07 23:15:09 +02:00
resolve({
browser: true,
skip: externals
2020-05-07 23:15:09 +02:00
}),
commonjs(),
json()
],
}