2021-01-30 15:54:52 +13:00
|
|
|
import commonjs from "@rollup/plugin-commonjs"
|
2021-01-22 05:44:03 +13:00
|
|
|
import resolve from "rollup-plugin-node-resolve"
|
|
|
|
import json from "@rollup/plugin-json"
|
2021-01-30 13:20:13 +13:00
|
|
|
import { terser } from "rollup-plugin-terser"
|
2021-04-02 04:09:16 +13:00
|
|
|
import builtins from "rollup-plugin-node-builtins"
|
|
|
|
import globals from "rollup-plugin-node-globals"
|
2022-09-07 19:48:29 +12:00
|
|
|
import injectProcessEnv from "rollup-plugin-inject-process-env"
|
2021-01-19 06:40:19 +13:00
|
|
|
|
2021-01-30 13:20:13 +13:00
|
|
|
const production = !process.env.ROLLUP_WATCH
|
2021-04-01 04:14:56 +13:00
|
|
|
|
|
|
|
export default [
|
|
|
|
{
|
2024-02-22 08:44:15 +13:00
|
|
|
input: "src/index.js",
|
2021-04-01 04:14:56 +13:00
|
|
|
output: {
|
|
|
|
sourcemap: !production,
|
2024-02-22 08:44:15 +13:00
|
|
|
format: "cjs",
|
|
|
|
file: "./dist/bundle.cjs",
|
2021-04-01 04:14:56 +13:00
|
|
|
},
|
2021-10-14 23:51:05 +13:00
|
|
|
plugins: [
|
|
|
|
resolve({
|
|
|
|
preferBuiltins: true,
|
|
|
|
browser: true,
|
|
|
|
}),
|
|
|
|
commonjs(),
|
|
|
|
globals(),
|
|
|
|
builtins(),
|
|
|
|
json(),
|
2022-09-07 19:48:29 +12:00
|
|
|
injectProcessEnv({
|
|
|
|
NO_JS: process.env.NO_JS,
|
|
|
|
}),
|
2021-10-14 23:51:05 +13:00
|
|
|
production && terser(),
|
|
|
|
],
|
2021-04-01 04:14:56 +13:00
|
|
|
},
|
|
|
|
]
|