Skip to content
Snippets Groups Projects
Select Git revision
  • 62fa90c63b7c3146f6cfdbc38e8a474fe45c0f55
  • master default protected
  • prod_dlrg
  • bugifx_configure_once
  • fix_path_chaos
  • feature_mumbleIntegration
6 results

setup.sh

Blame
  • esbuild.mjs 592 B
    import * as esbuild from 'esbuild';
    
    // Fetch 'RELATIVE_URL_ROOT' ENV variable value while removing any trailing slashes.
    const relativeUrlRoot = (process.env.RELATIVE_URL_ROOT || '').replace(/\/*$/, '');
    
    await esbuild.build({
      entryPoints: ['app/javascript/main.jsx'],
      bundle: true,
      minify: true,
      outdir: 'app/assets/builds',
      loader: {
        '.png': 'dataurl',
        '.svg': 'text',
      },
      define: {
        'process.env.RELATIVE_URL_ROOT': `"${relativeUrlRoot}"`,
        'process.env.OMNIAUTH_PATH': `"${relativeUrlRoot}/auth/openid_connect"`,
      },
    });
    
    console.log('watch build finished');