-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrollup.config.js
More file actions
37 lines (30 loc) · 1020 Bytes
/
rollup.config.js
File metadata and controls
37 lines (30 loc) · 1020 Bytes
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
import copy from "rollup-plugin-copy";
import replace from "@rollup/plugin-replace";
import { join } from "path";
import { sourcePath, widgetPackage, widgetName } from "./node_modules/@mendix/pluggable-widgets-tools/configs/shared";
const outDir = join(sourcePath, "/dist/tmp/");
const widgetDir = join("/widgets/", widgetPackage.replace(/\./g, "/"), widgetName.toLowerCase());
const aceDir = join(widgetDir, "ace-builds")
export default args => {
const config = args.configDefaultConfig;
config[0].plugins.unshift(
copy({
targets: [
{
src: ["node_modules/ace-builds/src-min-noconflict/*", "node_modules/ace-builds/LICENSE"],
ignore: ["node_modules/ace-builds/src-min-noconflict/ace.js"],
dest: join(outDir, aceDir)
}
]
}),
replace({
preventAssignment: true,
delimiters: ["<%", "%>"],
include: `src/${widgetName}.tsx`,
values: {
"ACEPATH": aceDir.replaceAll("\\", "/")
}
})
)
return config;
};