forked from telerik/kendo-ui-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.dev.config.js
32 lines (28 loc) · 938 Bytes
/
rollup.dev.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
import glob from 'glob';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import path from 'path';
import { baseOptions, root } from './rollup.config';
const files = glob.sync('**/kendo.*.js', { cwd: root })
.filter((file) => !['jquery.js', 'jquery.min.js', 'jszip.js', 'jszip.min.js'].includes(file));
const resolvedFiles = files.map(f => path.resolve(root, f));
const configMap = (file) => ({
input: path.resolve(root, file),
output: [{
format: "umd",
file: `./dist/dev/js/${file}`,
sourcemap: 'inline',
name: file.replace('.', ''),
...baseOptions
},{
format: "esm",
file: `./dist/mjs/${file}`,
sourcemap: 'inline',
...baseOptions
}],
external: resolvedFiles.filter(f => f !== path.resolve(root, file)),
treeshake: false,
plugins: [
nodeResolve()
]
});
export default files.map((file) => configMap(file));