-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
48 lines (46 loc) · 1.05 KB
/
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
39
40
41
42
43
44
45
46
47
48
import typescript from '@rollup/plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import dev from 'rollup-plugin-dev';
import process from 'process';
import dotenv from 'dotenv';
dotenv.config();
const { NODE_ENV, HOST_URL } = process.env;
const OUTPUT_DIR = './demo/dist';
export default {
input: [
'./demo/scripts/index.ts',
'./demo/scripts/header.ts',
'./demo/scripts/playground.ts',
],
output: [
{
format: 'esm',
dir: OUTPUT_DIR,
externalLiveBindings: false,
},
],
external: [],
plugins: [
typescript({
tsconfig: './tsconfig.json',
compilerOptions: {
outDir: OUTPUT_DIR,
target: 'es6',
strict: false,
},
allowSyntheticDefaultImports: true,
}),
resolve(),
commonjs(),
replace({
values: { HOST_URL: HOST_URL, NODE_ENV: NODE_ENV },
preventAssignment: true,
}),
dev({
dirs: ['demo'],
port: 8000,
}),
],
};