-
Notifications
You must be signed in to change notification settings - Fork 77
/
rollup.config.js
52 lines (50 loc) · 1.32 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
52
import path from 'path'
import typescript from 'rollup-plugin-typescript2'
import resolve from '@rollup/plugin-node-resolve'
import copy from 'rollup-plugin-copy'
function createRollupConfig({ basePath }) {
return {
input: path.join(basePath, 'src/index.ts'),
output: [
{
file: path.join(basePath, 'dist', `${path.basename(basePath)}.cjs.js`),
format: 'cjs',
},
{
file: path.join(basePath, 'dist', `${path.basename(basePath)}.js`),
format: 'es',
},
],
plugins: [
typescript({
tsconfig: path.join(basePath, 'tsconfig.json'),
cwd: basePath,
clean: true,
}),
resolve({
extensions: ['.ts', '.js'],
}),
copy({
targets: [
{
src: path.resolve('./README.md'),
dest: basePath,
},
],
}),
],
external: ['react', '@editorjs/editorjs', '@editorjs/paragraph'],
}
}
export default [
createRollupConfig({
basePath: path.resolve('./packages/@react-editor-js/core'),
}),
createRollupConfig({
basePath: path.resolve('./packages/@react-editor-js/client'),
}),
createRollupConfig({
basePath: path.resolve('./packages/@react-editor-js/server'),
}),
createRollupConfig({ basePath: path.resolve('./packages/react-editor-js') }),
]