-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.mjs
49 lines (48 loc) · 1.14 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
import commonjs from '@rollup/plugin-commonjs';
import copy from 'rollup-plugin-copy';
import nodeResolve from '@rollup/plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import terser from '@rollup/plugin-terser';
import pkg from './package.json' with { type: 'json' };
import ts from 'typescript';
export default {
input: 'src/index.ts',
output: [
{
file: pkg.module,
format: 'esm',
sourcemap: true,
},
{
file: pkg.main,
format: 'umd',
sourcemap: true,
name: 'geoimport',
},
],
plugins: [
commonjs(),
nodeResolve({
browser: true,
extensions: ['.js', '.ts', '.wasm', '.data'],
}),
typescript({ typescript: ts }),
copy({
targets: [
{
src: 'node_modules/gdal3.js/dist/package/gdal3WebAssembly.wasm',
dest: 'dist/static',
},
{
src: 'node_modules/gdal3.js/dist/package/gdal3WebAssembly.data',
dest: 'dist/static',
},
{
src: 'node_modules/gdal3.js/dist/package/gdal3.js',
dest: 'dist/static',
},
],
}),
terser(),
],
};