-
Notifications
You must be signed in to change notification settings - Fork 29
/
rollup.config.js
39 lines (38 loc) · 979 Bytes
/
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
/* eslint-env node */
import typescript from 'rollup-plugin-typescript2';
import pkg from './package.json';
import { terser } from 'rollup-plugin-terser';
import resolve from 'rollup-plugin-node-resolve';
import dts from 'rollup-plugin-dts';
export default [
{
input: 'src/gcode-preview.ts', // our source file
output: [
{
file: pkg.main,
format: 'es' // the preferred format
},
{
file: 'dist/gcode-preview.js',
format: 'umd',
name: 'GCodePreview', // the global which can be used in a browser
globals: {
three: 'THREE'
}
}
],
external: [...Object.keys(pkg.dependencies || {})],
plugins: [
resolve(),
typescript({
typescript: require('typescript')
}),
terser() // minifies generated bundles
]
},
{
input: 'src/gcode-preview.ts',
output: [{ file: 'dist/gcode-preview.d.ts', format: 'es' }],
plugins: [dts()]
}
];