// -*- javascript -*-
import sourcemaps from 'rollup-plugin-sourcemaps';
import resolve from '@rollup/plugin-node-resolve';
import path from 'path';

const babylon = '@babylonjs/core/Legacy/legacy';

export default {
  input: 'lib/index.js',
  plugins: [
    resolve({ browser: true }),
    sourcemaps(),
  ],
  external: [
    babylon,
    '@preserves/core',
    '@syndicate-lang/core',
    '@syndicate-lang/html',
    '@syndicate-lang/timer',
    '@syndicate-lang/ws-relay',
  ],
  output: {
    file: 'index.js',
    format: 'umd',
    name: 'Main',
    sourcemap: true,
    globals: {
      [babylon]: 'BABYLON',
      '@preserves/core': 'Preserves',
      '@syndicate-lang/core': 'Syndicate',
      '@syndicate-lang/html': 'SyndicateHtml',
      '@syndicate-lang/timer': 'SyndicateTimer',
      '@syndicate-lang/ws-relay': 'SyndicateWsRelay',
    },
  },
};
