2020-05-07 23:15:09 +02:00
|
|
|
import commonjs from "@rollup/plugin-commonjs"
|
2020-11-17 13:08:24 +01:00
|
|
|
import resolve from "@rollup/plugin-node-resolve"
|
|
|
|
import svelte from "rollup-plugin-svelte"
|
2020-08-12 18:41:12 +02:00
|
|
|
import postcss from "rollup-plugin-postcss"
|
2020-12-03 15:03:17 +01:00
|
|
|
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
|
|
|
|
2020-12-03 15:03:17 +01:00
|
|
|
import builtins from 'rollup-plugin-node-builtins'
|
|
|
|
|
2020-10-15 10:04:57 +02:00
|
|
|
const production = !process.env.ROLLUP_WATCH
|
2020-11-18 20:18:18 +01:00
|
|
|
const externals = ["svelte", "svelte/internal"]
|
2020-08-26 18:03:30 +02:00
|
|
|
|
2019-08-19 22:18:23 +02:00
|
|
|
export default {
|
2020-11-18 20:18:18 +01:00
|
|
|
external: externals,
|
2020-02-03 10:24:25 +01:00
|
|
|
input: "src/index.js",
|
|
|
|
output: [
|
|
|
|
{
|
|
|
|
file: "dist/index.js",
|
|
|
|
format: "esm",
|
2020-11-17 13:08:24 +01:00
|
|
|
sourcemap: false,
|
2020-02-03 10:24:25 +01:00
|
|
|
},
|
|
|
|
],
|
|
|
|
plugins: [
|
2020-12-03 15:03:17 +01:00
|
|
|
builtins(),
|
2020-10-15 10:04:57 +02:00
|
|
|
production && terser(),
|
2020-11-17 13:08:24 +01:00
|
|
|
postcss(),
|
2020-02-03 10:24:25 +01:00
|
|
|
svelte({
|
2020-11-17 13:08:24 +01:00
|
|
|
dev: !production,
|
2020-02-03 10:24:25 +01:00
|
|
|
}),
|
2020-05-07 23:15:09 +02:00
|
|
|
resolve({
|
|
|
|
browser: true,
|
2020-11-18 20:18:18 +01:00
|
|
|
skip: externals,
|
2020-05-07 23:15:09 +02:00
|
|
|
}),
|
2020-11-17 13:08:24 +01:00
|
|
|
commonjs(),
|
2020-12-03 15:03:17 +01:00
|
|
|
json(),
|
2020-02-03 10:24:25 +01:00
|
|
|
],
|
|
|
|
}
|