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

38 lines
802 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
import builtins from 'rollup-plugin-node-builtins'
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: [
builtins(),
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(),
],
}