-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.mjs
62 lines (61 loc) · 1.72 KB
/
rollup.config.mjs
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
import generatePackageJson from 'rollup-plugin-generate-package-json';
import postcss from 'rollup-plugin-postcss';
import { string } from 'rollup-plugin-string';
import ts from 'rollup-plugin-ts';
export default {
input: 'src/index.ts',
output: [
{
file: 'dist/index.js',
format: 'umd',
name: 'PhotoSphereViewerLensflarePlugin',
sourcemap: true,
globals: {
'three': 'THREE',
'@photo-sphere-viewer/core': 'PhotoSphereViewer',
},
},
{
file: 'dist/index.module.js',
format: 'es',
sourcemap: true,
globals: {
'three': 'THREE',
'@photo-sphere-viewer/core': 'PhotoSphereViewer',
},
},
],
external: [
'three',
'@photo-sphere-viewer/core',
],
plugins: [
ts(),
postcss({
extract: 'index.css',
sourceMap: true,
use: ['sass'],
}),
string({
include: ['**/*.svg'],
}),
generatePackageJson({
baseContents: (pkg) => {
pkg = {
...pkg,
main: 'index.js',
module: 'index.module.js',
types: 'index.d.ts',
style: 'index.css',
};
delete pkg.scripts;
delete pkg.devDependencies;
return pkg;
},
// this is only necessary for this demo, to override the "file" dependency
additionalDependencies: {
'@photo-sphere-viewer/core': '^5.6.0',
},
}),
],
};