forked from telerik/kendo-ui-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.mjs.config.js
51 lines (48 loc) · 1.36 KB
/
rollup.mjs.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
import { files, cultures, messages, addKendoVersion, baseOptions, externals, removeBundle, root } from './rollup.config';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import polyfill from 'rollup-plugin-polyfill';
/**
* @type {import('rollup').RollupOptions}
*/
const resourcesConfig = (name, options = {}) => ({
input: `${root}/${name}`,
output: [{
format: "esm",
dir: `./dist/raw-mjs/${options.dir}`,
sourcemap: false,
plugins: [
addKendoVersion()
],
...baseOptions
}],
external: ['../kendo.core.js'],
treeshake: false,
plugins: [
polyfill(['../kendo.core.js'])
]
});
// rollup.config.js
/**
* @type {import('rollup').RollupOptions}
*/
const configMap = (name) => ({
input: `${root}/${name}`,
output: [{
format: 'esm',
dir: './dist/raw-mjs',
sourcemap: false,
plugins: [
addKendoVersion()
],
...baseOptions
}
],
external: externals.filter(removeBundle(name)),
treeshake: false,
plugins: [
nodeResolve(),
]
});
export default files.map((name) => configMap(name))
.concat(cultures.map((name) => resourcesConfig(name, { dir: 'cultures' })))
.concat(messages.map((name) => resourcesConfig(name, { dir: 'messages' })));