-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrollup.config.js
43 lines (42 loc) · 1.04 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
import typescript from 'rollup-plugin-typescript2';
import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';
import scss from 'rollup-plugin-scss';
import react from 'react';
import nodeResolve from 'rollup-plugin-node-resolve';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import babel from 'rollup-plugin-babel';
import fs from 'fs';
export default {
input: 'src/index.ts',
output: {
dir: 'dist',
format: 'cjs',
exports: 'named',
name: 'codeInput',
},
external: ['react', 'react-dom'],
plugins: [
typescript ({
tsconfig: 'tsconfig.json',
objectHashIgnoreUnknownHack: true,
}),
resolve (),
commonjs ({
namedExports: {
'node_modules/react/index.js': Object.keys (react),
'node_modules/react-dom/index.js': ['render'],
},
}),
babel ({
external: 'node_modules/**',
}),
scss ({
output: './dist/bundle.css',
}),
nodeResolve ({
modulesOnly: true,
}),
peerDepsExternal (),
],
};