-
Notifications
You must be signed in to change notification settings - Fork 73
/
rollup.config.js
56 lines (54 loc) · 1.17 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 babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import cleanup from 'rollup-plugin-cleanup';
// import { fileSync as find } from 'find';
const name = 'VueBabylonjs';
const plugins = [
resolve(),
babel({
runtimeHelpers: true,
plugins: ['@babel/plugin-external-helpers', '@babel/plugin-transform-runtime'],
ignore: ['node_modules/!(@babylonjs)'],
}),
commonjs({
include: 'node_modules/**',
}),
cleanup(),
];
// const FILES = find(/.*\/.+\/.+\.js$/, './src').reduce((out, file) => ({
// ...out,
// [file.replace(/src\//, '').replace(/\.js$/, '')]: file,
// }), {});
export default [{
input: 'src/index.js',
output: {
format: 'es',
file: 'dist/esm.js',
},
external: [
'@babylonjs/core',
'@babylonjs/loaders',
],
plugins,
}, {
input: 'src/full.js',
output: {
format: 'umd',
name,
file: 'dist/umd.js',
},
plugins,
// }, {
// input: {
// index: 'src/core.js',
// ...FILES,
// },
// experimentalCodeSplitting: true,
// output: {
// format: 'cjs',
// dir: './lib',
// globals,
// },
// plugins,
}];