packages/bsb-js/index.js
function compileFileSync(
  buildDir /*: string */,
  moduleType /*: BsModuleFormat | 'js' */,
  path /*: string */,
) /*: string */ {
  try {
    runBuildSync(buildDir)
  } catch (e) {
    throw utils.processBsbError(e.output.toString())
  }

  const res = readFileSync(path)
  return utils.transformSrc(moduleType, res.toString())
}
function compileFileSync(
  buildDir /*: string */,
  moduleType /*: BsModuleFormat | 'js' */,
  path /*: string */,
) /*: string */ {
  try {
    runBuildSync(buildDir)
  } catch (e) {
    throw utils.processBsbError(e.output.toString())
  }

  const res = readFileSync(path)
  return utils.transformSrc(moduleType, res.toString())
}
function compileFileSync ( buildDir /*: string */ , moduleType /*: BsModuleFormat | 'js' */ , path /*: string */ , ) /*: string */ { try { runBuildSync ( buildDir ) } catch ( e ) { throw utils . processBsbError ( e . output . toString ( ) ) } const res = readFileSync ( path ) return utils . transformSrc ( moduleType , res . toString ( ) ) }
Compiles a Reason file to JS sync
Compiles a Reason file to JS sync