     #inlineMap: true  # rely on Babel's source map
     transpile: babelConfig
 
-  require('@babel/register') babelConfig
+  ## Prevent Babel from caching its results, for changes to our plugins.
+  require('@babel/register') {...babelConfig, cache: false}
+
   CoffeeScript = require 'coffeescript'
   CoffeeScript.FILE_EXTENSIONS = ['.coffee', '.cjsx']
   CoffeeScript.register()

      ## Normally use `require` to load code as a real NodeJS module
      filename = path.resolve @filename
      ## Debug Babel output
      #{code} = require('@babel/core').transform fs.readFileSync(filename), {
      #  ...babelConfig
      #  filename: @filename
      #}
      #console.log code
      pirates?.settings = @settings
      @module = runWithMapping @, -> require filename
      super @module.default ? {}

        lastNode = last.node
        if types.isExpressionStatement(last) and (
          types.isObjectExpression(lastNode.expression) or
          types.isFunctionExpression(lastNode.expression) or
          types.isArrowFunctionExpression(lastNode.expression)
          # not AssignmentExpression or CallExpression
        )
          exportLast = types.exportDefaultDeclaration lastNode.expression
          exportLast.leadingComments = lastNode.leadingComments
