aboutsummaryrefslogtreecommitdiff
path: root/rollup.config.js
blob: cfe0a4b8ae76b46cf279155d3d54fdb1117400c8 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// rollup.config.js
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import json from '@rollup/plugin-json';
import builtins from 'builtin-modules'

const walletCli = {
  input: 'dist/node/headless/taler-wallet-cli.js',
  output: {
    file: 'dist/standalone/taler-wallet-cli.js',
    format: 'cjs'
  },
  external: builtins,
  plugins: [
    nodeResolve({
      preferBuiltins: true,
    }),
    commonjs({
      include: ['node_modules/**', 'dist/node/**'],
      extensions: [ '.js' ],
      ignoreGlobal: false,  // Default: false
      sourceMap: false,
      ignore: [ 'taler-wallet' ]
    }),

    json(),

  ]
};

const walletAndroid = {
  input: 'dist/node/android/index.js',
  output: {
    file: 'dist/standalone/taler-wallet-android.js',
    format: 'cjs',
    exports: 'named',
  },
  external: builtins,
  plugins: [
    json(),

    nodeResolve({
      preferBuiltins: true
    }),

    commonjs({
      include: ['node_modules/**', 'dist/node/**'],
      extensions: [ '.js' ],
      ignoreGlobal: false,  // Default: false
      sourceMap: false,
      ignore: [ 'taler-wallet' ]
    })
  ]
};

export default [walletCli, walletAndroid];