forked from mapbox/mapbox-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.csp.js
More file actions
27 lines (24 loc) · 1.02 KB
/
rollup.config.csp.js
File metadata and controls
27 lines (24 loc) · 1.02 KB
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.js';
import banner from './build/banner.js';
// 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, file, format) => ({
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
input,
output: {
name: 'mapboxgl',
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
file,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
format,
sourcemap: true,
indent: false,
banner
},
treeshake: {preset: 'recommended', moduleSideEffects: (id) => !id.endsWith('devtools.ts')},
plugins: plugins({minified: true, production: true, keepClassNames: true, test: false, bench: false, mode: 'production'})
});
export default [
config('src/index.ts', 'dist/mapbox-gl-csp.js', 'umd'),
config('src/source/worker.ts', 'dist/mapbox-gl-csp-worker.js', 'iife')
];