Skip to content
Snippets Groups Projects
Select Git revision
  • b777fb0fd5b09f0bd1787da566c98f8ed4180f95
  • 2023ss default protected
  • 2022ss
  • 2021ss
  • 2020ss
  • 2019ss
  • 2018ss
  • 2017ss
  • 2016ss
  • 2015ss
  • 2014ss
11 results

hello

Blame
  • Forked from Peter Gerwinski / bs
    Source project has a limited visibility.
    esbuild.dev.mjs 773 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,
      sourcemap: true,
      outdir: 'app/assets/builds',
      loader: {
        '.png': 'dataurl',
        '.svg': 'text',
      },
      watch: {
        onRebuild: (error, result) => {
          if (error) console.error('watch build failed:', error);
          else console.log('watch build succeeded:', result);
        },
      },
      define: {
        'process.env.RELATIVE_URL_ROOT': `"${relativeUrlRoot}"`,
        'process.env.OMNIAUTH_PATH': `"${relativeUrlRoot}/auth/openid_connect"`,
      },
    });
    
    console.log('watch build started');