-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
51 lines (48 loc) · 1.26 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
49
50
51
import typescript from '@rollup/plugin-typescript';
import commonjs from "@rollup/plugin-commonjs";
import {dts} from "rollup-plugin-dts";
import json from "@rollup/plugin-json";
import nodeResolve from "@rollup/plugin-node-resolve";
const external = ['playwright', 'playwright-core', 'yargs', 'chalk'];
const plugins = [typescript(), commonjs(), json(), nodeResolve()];
const sourcemap = true;
export default [
{
input: ['src/index.ts'],
plugins,
external: external.concat('@tbela99/css-parser'),
output: [{
dir: './dist',
preserveModules: true,
sourcemap,
name: 'critical',
format: 'es',
}]
},
{
input: 'src/browser.ts',
plugins,
external,
output: [
{
sourcemap,
file: './dist/browser.js',
format: 'es'
},
{
sourcemap,
file: './dist/browser-umd.js',
format: 'iife',
name: 'critical'
}
]
},
{
input: 'src/index.ts',
plugins: [nodeResolve(), dts()],
output: {
file: './dist/index.d.ts',
format: 'es'
}
}
]