forked from telerik/kendo-ui-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrolldown.config.dev.mjs
More file actions
54 lines (50 loc) · 1.22 KB
/
rolldown.config.dev.mjs
File metadata and controls
54 lines (50 loc) · 1.22 KB
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
53
54
import glob from 'glob';
import path from 'path';
import { version } from './build/gulp/kendo-version.mjs';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const rootPath = path.resolve(__dirname, './src');
const files = glob.sync('./src/kendo.*.js');
const cultures = glob.sync('./src/cultures/*.js');
const messages = glob.sync('./src/messages/*.js');
/**
* @type {import('rolldown').RolldownPlugin}
*/
const replaceVersion = {
name: 'replace-version',
transform: {
filter: /kendo\.licensing\.js$/,
handler(code) {
return code.replace(/\$KENDO_VERSION/gm, version);
}
}
};
/**
* @type {import('rolldown').RolldownOptions[]}
*/
export default [{
input: files,
treeshake: false,
output: [{
dir: './dev',
format: 'esm',
entryFileNames: '[name].js',
preserveModules: true,
preserveModulesRoot: rootPath
}],
plugins: [replaceVersion]
}, {
input: cultures,
treeshake: false,
output: [{
dir: './dev/cultures',
format: 'esm',
}],
}, {
input: messages,
treeshake: false,
output: [{
dir: './dev/messages',
format: 'esm',
}]
}];