forked from mapbox/mapbox-gl-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup_config_benchmarks.js
38 lines (34 loc) · 1.16 KB
/
rollup_config_benchmarks.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
import fs from 'fs';
import sourcemaps from 'rollup-plugin-sourcemaps';
import replace from 'rollup-plugin-replace';
import {plugins as basePlugins} from '../build/rollup_plugins';
const plugins = () => basePlugins().concat(
replace({
'process.env.BENCHMARK_VERSION': JSON.stringify(process.env.BENCHMARK_VERSION),
'process.env.MAPBOX_ACCESS_TOKEN': JSON.stringify(process.env.MAPBOX_ACCESS_TOKEN),
'process.env.MapboxAccessToken': JSON.stringify(process.env.MapboxAccessToken),
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
);
const config = [{
input: ['bench/benchmarks.js', 'src/source/worker.js'],
output: {
dir: 'rollup/build/benchmarks',
format: 'amd',
sourcemap: 'inline'
},
experimentalCodeSplitting: true,
plugins: plugins()
}, {
input: 'rollup/benchmarks.js',
output: {
file: 'bench/benchmarks_generated.js',
format: 'umd',
sourcemap: 'inline',
intro: fs.readFileSync(require.resolve('../rollup/bundle_prelude.js'), 'utf8')
},
treeshake: false,
indent: false,
plugins: [sourcemaps()],
}];
export default config;