budibase/packages/string-templates/rollup.config.js

37 lines
919 B
JavaScript
Raw Normal View History

import commonjs from "@rollup/plugin-commonjs"
2021-01-21 17:44:03 +01:00
import resolve from "rollup-plugin-node-resolve"
import json from "@rollup/plugin-json"
import { terser } from "rollup-plugin-terser"
import builtins from "rollup-plugin-node-builtins"
import globals from "rollup-plugin-node-globals"
2024-02-21 20:45:35 +01:00
import typescript from "@rollup/plugin-typescript"
import injectProcessEnv from "rollup-plugin-inject-process-env"
const production = !process.env.ROLLUP_WATCH
export default [
{
2024-02-21 20:50:57 +01:00
input: "src/index.ts",
output: {
sourcemap: !production,
2024-02-21 20:44:15 +01:00
format: "cjs",
file: "./dist/bundle.cjs",
},
plugins: [
2024-02-21 21:10:53 +01:00
typescript({ tsconfig: "tsconfig.json" }),
resolve({
preferBuiltins: true,
browser: true,
}),
commonjs(),
globals(),
builtins(),
json(),
injectProcessEnv({
NO_JS: process.env.NO_JS,
}),
production && terser(),
],
},
]