-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
38 lines (36 loc) · 983 Bytes
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import typescript from "@rollup/plugin-typescript";
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import { terser } from "rollup-plugin-terser";
import json from "@rollup/plugin-json";
import builtins from "rollup-plugin-node-builtins";
import replace from "@rollup/plugin-replace";
const AUTH_URL =
process.env.NODE_ENV === "production"
? "https://oauth.aspen.cloud/oauth2/"
: "https://localhost:9000/oauth2/";
const API_URL =
process.env.NODE_ENV === "production"
? "https://app.aspen.cloud/api"
: "http://localhost:3000/api";
export default {
input: "src/index.ts",
output: {
dir: "lib",
format: "umd",
name: "aspen",
sourcemap: false,
},
plugins: [
replace({
__AUTH_URL__: AUTH_URL,
__API_URL__: API_URL,
}),
json(),
builtins(),
commonjs(),
resolve({ browser: true }),
typescript({ module: "ES2015", outDir: "lib" }),
terser(),
],
};