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

51 lines
1.2 KiB
JavaScript
Raw Normal View History

import alias from "@rollup/plugin-alias"
2020-05-07 23:15:09 +02:00
import commonjs from "@rollup/plugin-commonjs"
import resolve from "@rollup/plugin-node-resolve"
import replace from "@rollup/plugin-replace"
import svelte from "rollup-plugin-svelte"
import postcss from "rollup-plugin-postcss"
2020-10-12 18:54:18 +02:00
import { terser } from "rollup-plugin-terser"
import path from "path"
2019-08-19 22:18:23 +02:00
const production = !process.env.ROLLUP_WATCH
const projectRootDir = path.resolve(__dirname)
2019-08-19 22:18:23 +02:00
export default {
input: "src/index.js",
output: [
{
file: "dist/index.js",
format: "esm",
name: "budibaseStandardComponents",
sourcemap: false,
},
],
plugins: [
alias({
entries: [
{
find: "@budibase/component-sdk",
replacement: path.resolve(
projectRootDir,
"../component-sdk/dist/budibase-component-sdk"
),
},
],
}),
production && terser(),
postcss(),
svelte({
dev: !production,
}),
2020-05-07 23:15:09 +02:00
resolve({
browser: true,
}),
commonjs(),
// Fix for https://github.com/sveltejs/svelte/issues/3165
replace({
"outros.c.push":
"if (outros === undefined) { block.o(local); return }\noutros.c.push",
}),
],
}