forked from beda-software/aidbox-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
49 lines (47 loc) · 1.41 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
const commonjs = require('@rollup/plugin-commonjs');
const resolve = require('@rollup/plugin-node-resolve');
const typescript = require('@rollup/plugin-typescript');
const dts = require('rollup-plugin-dts');
const packageJson = require('./package.json');
module.exports = [
{
input: 'src/index.ts',
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: false,
},
{
file: packageJson.module,
format: 'esm',
sourcemap: false,
},
],
external: ['axios', 'moment', 'shared/src/contrib/aidbox'],
plugins: [
resolve({
browser: true,
preferBuiltins: false,
}),
commonjs(),
typescript({
tsconfig: './tsconfig.json',
compilerOptions: {
target: 'es2016',
module: 'ESNext',
moduleResolution: 'node',
sourceMap: false,
},
include: ['src/**/*'],
exclude: ['**/__tests__/**/*', '**/*.test.*'],
}),
],
},
{
input: 'dist/esm/index.d.ts',
output: [{ file: 'dist/index.d.ts', format: 'esm' }],
external: [/\.(css|less|scss)$/],
plugins: [dts.default()],
},
];