forked from maplibre/maplibre-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.csp.ts
More file actions
27 lines (24 loc) · 867 Bytes
/
rollup.config.csp.ts
File metadata and controls
27 lines (24 loc) · 867 Bytes
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
import {plugins} from './build/rollup_plugins';
import banner from './build/banner';
import {InputOption, ModuleFormat, RollupOptions} from 'rollup';
import {importAssertions} from 'acorn-import-assertions';
// a config for generating a special GL JS bundle with static web worker code (in a separate file)
// https://github.com/mapbox/mapbox-gl-js/issues/6058
const config = (input: InputOption, file: string, format: ModuleFormat): RollupOptions => ({
input,
output: {
name: 'maplibregl',
file,
format,
sourcemap: true,
indent: false,
banner
},
treeshake: true,
acornInjectPlugins: [ importAssertions ],
plugins: plugins(true)
});
export default [
config('src/index.ts', 'dist/maplibre-gl-csp.js', 'umd'),
config('src/source/worker.ts', 'dist/maplibre-gl-csp-worker.js', 'iife')
];