forked from SVG-Edit/svgedit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup-config.config.js
55 lines (53 loc) · 1.32 KB
/
rollup-config.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
53
54
55
/* eslint-env node */
import babel from 'rollup-plugin-babel';
import replace from 'rollup-plugin-re';
const plugins = [
replace({
patterns: [
{
match: /svgedit-config-es\.js/,
test: 'svgedit-config-es.js',
replace: 'svgedit-config-iife.js'
},
{
match: /svgedit-config-es\.js/,
test: "import svgEditor from './editor/svg-editor.js';", // Sets `svgEditor` global for extensions/locales
replace: `import svgEditor from './editor/svg-editor.js';
window.svgEditor = svgEditor;
window.svgEditor.modules = false;
`
},
{
match: /xdomain-svgedit-config-es\.js/,
test: "import svgEditor from './svg-editor.js';",
replace: `import svgEditor from './svg-editor.js';
window.svgEditor = svgEditor;
window.svgEditor.modules = false;
`
}
]
}),
babel({
plugins: ['transform-object-rest-spread']
})
];
/* eslint-disable import/no-anonymous-default-export */
export default [
{
input: 'svgedit-config-es.js',
output: {
format: 'iife',
file: 'svgedit-config-iife.js'
},
plugins
},
{
input: 'editor/xdomain-svgedit-config-es.js',
output: {
format: 'iife',
file: 'editor/xdomain-svgedit-config-iife.js'
},
plugins
}
];
/* eslint-enable import/no-anonymous-default-export */