src/configs/webpack/rules/default.js
function fileName(file) {
  let prefix = null
  let reference = null

  if (isPathSubDirOf(file, PROJECT_DIR)) {
    // Assets from the target project.
    prefix = []
    reference = PROJECT_DIR
  } else if (isPathSubDirOf(file, TOOLBOX_DIR)) {
    // Assets from the Toolbox.
    prefix = ['__borela__']
    reference = TOOLBOX_DIR
  }

  const RELATIVE = relative(reference, file)
  let nodes = RELATIVE.split(sep)

  if (nodes[0] === 'src')
    nodes.shift()

  if (prefix.length > 0)
    nodes = [...prefix, ...nodes]

  return `${nodes.join('/')}?[sha512:hash:base64:8]`
}
function fileName(file) {
  let prefix = null
  let reference = null

  if (isPathSubDirOf(file, PROJECT_DIR)) {
    // Assets from the target project.
    prefix = []
    reference = PROJECT_DIR
  } else if (isPathSubDirOf(file, TOOLBOX_DIR)) {
    // Assets from the Toolbox.
    prefix = ['__borela__']
    reference = TOOLBOX_DIR
  }

  const RELATIVE = relative(reference, file)
  let nodes = RELATIVE.split(sep)

  if (nodes[0] === 'src')
    nodes.shift()

  if (prefix.length > 0)
    nodes = [...prefix, ...nodes]

  return `${nodes.join('/')}?[sha512:hash:base64:8]`
}
function fileName ( file ) { let prefix = null let reference = null if ( isPathSubDirOf ( file , PROJECT_DIR ) ) { // Assets from the target project. prefix = [ ] reference = PROJECT_DIR } else if ( isPathSubDirOf ( file , TOOLBOX_DIR ) ) { // Assets from the Toolbox. prefix = [ '__borela__' ] reference = TOOLBOX_DIR } const RELATIVE = relative ( reference , file ) let nodes = RELATIVE . split ( sep ) if ( nodes [ 0 ] === 'src' ) nodes . shift ( ) if ( prefix . length > 0 ) nodes = [ ... prefix , ... nodes ] return ` ${ nodes . join ( '/' ) } ` }
Calculate the file path for the loaded asset.
Calculate the file path for the loaded asset .