blob: e63c7bef888f55224a170437164468cb00efb671 [file] [log] [blame]
Hector Dearmanb06d4152018-05-31 16:55:04 +01001import commonjs from 'rollup-plugin-commonjs';
2import nodeResolve from 'rollup-plugin-node-resolve';
Hector Dearman5ae82472018-10-03 08:30:35 +01003import replace from 'rollup-plugin-replace';
Hector Dearmanb06d4152018-05-31 16:55:04 +01004
5export default {
Hector Dearman03f962c2018-08-09 17:00:32 +01006 output: {name: 'perfetto'},
Hector Dearmanb06d4152018-05-31 16:55:04 +01007 plugins: [
Hector Dearman03f962c2018-08-09 17:00:32 +01008 nodeResolve({browser: true}),
Hector Dearman21fa9162018-06-22 14:50:29 +01009
Primiano Tucci1c752c12018-10-23 09:27:19 +010010 // emscripten conditionally executes require('fs') (likewise for others),
11 // when running under node. Rollup can't find those libraries so expects
12 // these to be present in the global scope, which then fails at runtime.
13 // To avoid this we ignore require('fs') and the like.
Hector Dearman21fa9162018-06-22 14:50:29 +010014 commonjs({
15 ignore: [
16 'fs',
Hector Dearman03f962c2018-08-09 17:00:32 +010017 'path',
Primiano Tucci1c752c12018-10-23 09:27:19 +010018 'crypto',
Hector Dearman21fa9162018-06-22 14:50:29 +010019 ]
Hector Dearman5ae82472018-10-03 08:30:35 +010020 }),
21
22 replace({
23 'immer_1.produce': 'immer_1',
Hector Dearman21fa9162018-06-22 14:50:29 +010024 })
Hector Dearman5ae82472018-10-03 08:30:35 +010025
Hector Dearmanb06d4152018-05-31 16:55:04 +010026 ]
27}