aboutsummaryrefslogtreecommitdiff
path: root/ui/rollup.config.js
blob: e4795c42480baec31678e944014a47030534f791 (plain)
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
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';

export default {
  output: {name: 'perfetto'},
  plugins:
      [
        nodeResolve({
          mainFields: ['browser'],
          browser: true,
          preferBuiltins: false,
        }),

        // emscripten conditionally executes require('fs') (likewise for
        // others), when running under node. Rollup can't find those libraries
        // so expects these to be present in the global scope, which then fails
        // at runtime. To avoid this we ignore require('fs') and the like.
        commonjs({
          ignore: [
            'fs',
            'path',
            'crypto',
          ]
        }),
      ],
}