-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
56 lines (53 loc) · 1.25 KB
/
rollup.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
56
import { getPlugins } from './scripts/rollup-config-helper';
import spineConfig from './rollup.spine.config';
import appxConfig from './rollup.appx.config';
const pkg = require('./package.json');
const banner = `/*!
* Name: ${pkg.name}
* Description: ${pkg.description}
* Author: ${pkg.author}
* Contributors: ${pkg.contributors.map(c => c.name).join(',')}
* Version: v${pkg.version}
*/
`;
const globals = {
'@galacean/engine': 'Galacean',
};
const external = Object.keys(globals);
const plugins = getPlugins(pkg);
export default (commandLineArgs) => {
return [
{
input: 'src/index.ts',
output: [{
file: pkg.module,
format: 'es',
banner,
globals,
sourcemap: true,
}, {
file: pkg.main,
format: 'cjs',
banner,
globals,
sourcemap: true,
}],
external,
plugins,
}, {
input: 'src/index.ts',
output: {
file: pkg.brower,
format: 'umd',
name: 'Galacean.effects',
banner,
globals,
sourcemap: true,
},
external,
plugins: getPlugins(pkg, { min: true }),
},
...spineConfig,
...appxConfig.map(config => ({ ...config, plugins: plugins.concat(config.plugins) }))
];
};