const { join, resolve } = require('path')
const { cache_path: cachePath, source_path: sourcePath } = require('../config')
const { nodeEnv } = require('../env')

// Process application Javascript code with Babel.
// Uses application .babelrc to apply any transformations
module.exports = {
  test: /\.(js|jsx|mjs)?(\.erb)?$/,
  include: resolve(sourcePath),
  exclude: /node_modules/,
  use: [
    {
      loader: 'babel-loader',
      options: {
        cacheDirectory: join(cachePath, 'babel-loader-node-modules'),
        cacheCompression: nodeEnv === 'production',
        compact: nodeEnv === 'production'
      }
    }
  ]
}

@@ -89,16 +89,47 @@
 urcePath
+, resolved_paths: resolvedPaths
  %7D = req
@@ -364,26 +364,58 @@
 de: 
-resolve(sourcePath
+%5BsourcePath, ...resolvedPaths%5D.map(p =%3E resolve(p)
 ),%0A 

Add resolved paths to app-code babel compile