-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrollup.config.js
More file actions
64 lines (61 loc) · 1.6 KB
/
Copy pathrollup.config.js
File metadata and controls
64 lines (61 loc) · 1.6 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
/*********************************************************************
* Copyright (c) Intel Corporation 2019
* SPDX-License-Identifier: Apache-2.0
**********************************************************************/
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import json from '@rollup/plugin-json'
import terser from '@rollup/plugin-terser'
import replace from '@rollup/plugin-replace'
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
import { readFileSync } from 'fs'
const packageJson = JSON.parse(readFileSync('./package.json', 'utf-8'))
export default [
{
input: 'src/index.ts',
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: true,
exports: 'named'
},
{
file: packageJson.module,
format: 'esm',
sourcemap: true,
exports: 'named'
}
],
plugins: [
peerDepsExternal(),
replace({
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify('production')
}),
resolve({
browser: true,
preferBuiltins: false
}),
commonjs(),
json(),
typescript({
tsconfig: './tsconfig.build.json',
declaration: true,
declarationDir: 'dist',
rootDir: 'src'
}),
terser()
],
external: [
'react',
'react-dom',
'react/jsx-runtime',
'i18next',
'react-i18next',
'@device-management-toolkit/ui-toolkit/core',
'@xterm/xterm'
]
}
]