-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathrollup.config.jsm.js
77 lines (73 loc) · 1.99 KB
/
rollup.config.jsm.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import path from 'path';
import copy from 'rollup-plugin-copy';
import * as fastGlob from 'fast-glob';
import {
platformize,
platformVariables,
useRealOpentypeModule,
importFromPlatfromizedThree,
} from './platfromize';
const ThreeOrigin = path.resolve(__dirname, '../three/build/three.module.js');
export default fastGlob.sync('three/examples/jsm/**/*.js').map(input => {
return {
input,
output: {
format: 'esm',
file: input.replace('three/', ''),
},
external: () => true,
plugins: [
importFromPlatfromizedThree(),
platformize(platformVariables, ThreeOrigin),
useRealOpentypeModule(),
copy({
targets: [
{
src: input.replace('.js', '.d.ts'),
dest: path.dirname(input.replace('three/', '')),
},
],
}),
],
};
});
// export default [
// {
// // input: ['three/examples/jsm/cameras/**/*.js'],
// // input: {
// // 'examples/jsm/cameras/CinematicCamera':
// // 'three/examples/jsm/cameras/CinematicCamera.js',
// // },
// input: 'three/examples/jsm/cameras/CinematicCamera.js',
// output: {
// format: 'esm',
// // dir: './',
// file: 'examples/jsm/cameras/CinematicCamera.js',
// paths: {
// // [ThreePlatformize]: ThreePlatformize,
// },
// },
// // external: [ThreePlatformize],
// external: () => true,
// plugins: [
// // importFromPlatfromizedThree(),
// platformize(platformVariables, ThreeOrigin),
// // dirInputOutput(),
// ],
// },
// // {
// // input: 'three/examples/jsm/loaders/GLTFLoader.js',
// // output: {
// // format: 'esm',
// // dir: 'build',
// // paths: {
// // [ThreePlatformize]: './three.module.js',
// // },
// // },
// // external: [ThreePlatformize],
// // plugins: [
// // importFromPlatfromizedThree(),
// // platformize(platformVariables, ThreePlatformize),
// // ],
// // },
// ];