diff --git a/src/DependencyGraph/ResolutionRequest.js b/src/DependencyGraph/ResolutionRequest.js
--- a/src/DependencyGraph/ResolutionRequest.js
+++ b/src/DependencyGraph/ResolutionRequest.js
@@ -104,7 +104,12 @@
       );
   }

-  getOrderedDependencies(response, mocksPattern, recursive = true) {
+  getOrderedDependencies(
+    response,
+    mocksPattern,
+    transformOptions,
+    recursive = true,
+  ) {
     return this._getAllMocks(mocksPattern).then(allMocks => {
       const entry = this._moduleCache.getModule(this._entryPath);
       const mocks = Object.create(null);
@@ -113,7 +118,7 @@

       response.pushDependency(entry);
       const collect = (mod) => {
-        return mod.getDependencies().then(
+        return mod.getDependencies(transformOptions).then(
           depNames => Promise.all(
             depNames.map(name => this.resolveDependency(mod, name))
           ).then((dependencies) => [depNames, dependencies])
@@ -137,9 +142,8 @@
               return [depNames, dependencies];
             });
           }
-          return Promise.resolve([depNames, dependencies]);
+          return [depNames, dependencies];
         }).then(([depNames, dependencies]) => {
-          let p = Promise.resolve();
           const filteredPairs = [];

           dependencies.forEach((modDep, i) => {
@@ -167,24 +171,21 @@

           response.setResolvedDependencyPairs(mod, filteredPairs);

-          filteredPairs.forEach(([depName, modDep]) => {
-            p = p.then(() => {
-              if (!visited[modDep.hash()]) {
+          return Promise.all(
+            filteredPairs
+              .filter(([, modDep]) => !visited[modDep.hash()])
+              .map(([depName, modDep]) => {
                 visited[modDep.hash()] = true;
-                response.pushDependency(modDep);
-                if (recursive) {
-                  return collect(modDep);
-                }
-              }
-              return null;
-            });
-          });
-
-          return p;
+                return Promise.all([modDep, recursive ? collect(modDep) : []]);
+              })
+          );
         });
       };

-      return collect(entry).then(() => response.setMocks(mocks));
+      return collect(entry).then(deps => {
+        recursiveFlatten(deps).forEach(dep => response.pushDependency(dep));
+        response.setMocks(mocks)
+      });
     });
   }

@@ -443,4 +444,11 @@
   return modulePath.replace(/\/$/, '');
 }

+function recursiveFlatten(array) {
+  return Array.prototype.concat.apply(
+    Array.prototype,
+    array.map(item => Array.isArray(item) ? recursiveFlatten(item) : item)
+  );
+}
+
 module.exports = ResolutionRequest;
diff --git a/src/DependencyGraph/ResolutionResponse.js b/src/DependencyGraph/ResolutionResponse.js
--- a/src/DependencyGraph/ResolutionResponse.js
+++ b/src/DependencyGraph/ResolutionResponse.js
@@ -14,6 +14,7 @@
     this.mainModuleId = null;
     this.mocks = null;
     this.numPrependedDependencies = 0;
+    this.transformOptions = undefined;
     this._mappings = Object.create(null);
     this._finalized = false;
   }
diff --git a/src/__tests__/DependencyGraph-test.js b/src/__tests__/DependencyGraph-test.js
--- a/src/__tests__/DependencyGraph-test.js
+++ b/src/__tests__/DependencyGraph-test.js
@@ -22,7 +22,7 @@
   let defaults;

   function getOrderedDependenciesAsJSON(dgraph, entry, platform, recursive = true) {
-    return dgraph.getDependencies(entry, platform, recursive)
+    return dgraph.getDependencies(entry, platform, undefined, recursive)
       .then(response => response.finalize())
       .then(({ dependencies }) => Promise.all(dependencies.map(dep => Promise.all([
         dep.getName(),
diff --git a/src/index.js b/src/index.js
--- a/src/index.js
+++ b/src/index.js
@@ -158,8 +158,10 @@
    * Returns a promise with the direct dependencies the module associated to
    * the given entryPath has.
    */
-  getShallowDependencies(entryPath) {
-    return this._moduleCache.getModule(entryPath).getDependencies();
+  getShallowDependencies(entryPath, transformOptions) {
+    return this._moduleCache
+      .getModule(entryPath)
+      .getDependencies(transformOptions);
   }

   getFS() {
@@ -177,7 +179,7 @@
     return this.load().then(() => this._moduleCache.getAllModules());
   }

-  getDependencies(entryPath, platform, recursive = true) {
+  getDependencies(entryPath, platform, transformOptions, recursive = true) {
     return this.load().then(() => {
       platform = this._getRequestPlatform(entryPath, platform);
       const absPath = this._getAbsolutePath(entryPath);
@@ -198,6 +200,7 @@
       return req.getOrderedDependencies(
         response,
         this._opts.mocksPattern,
+        transformOptions,
         recursive,
       ).then(() => response);
     });
@@ -272,6 +275,10 @@
     });
   }

+  createPolyfill(options) {
+    return this._moduleCache.createPolyfill(options);
+  }
+
 }

 function NotFoundError() {
diff --git a/src/Module.js b/src/Module.js
--- a/src/Module.js
+++ b/src/Module.js
@@ -133,22 +133,27 @@
         return Promise.all([
           fileContentPromise,
           this._readDocBlock(fileContentPromise),
-        ]).then(([code, {id, moduleDocBlock}]) => {
+        ]).then(([sourceCode, {id, moduleDocBlock}]) => {
           // Ignore requires in JSON files or generated code. An example of this
           // is prebuilt files like the SourceMap library.
           if (this.isJSON() || 'extern' in moduleDocBlock) {
-            return {id, code, dependencies: []};
+            return {id, code: sourceCode, sourceCode, dependencies: []};
           } else {
             const transformCode = this._transformCode;
             const codePromise = transformCode
-                ? transformCode(this, code, transformOptions)
-                : Promise.resolve({code});
+                ? transformCode(this, sourceCode, transformOptions)
+                : Promise.resolve({code: sourceCode});

-            return codePromise.then(({code, dependencies, map}) => {
+            return codePromise.then(({
+              code,
+              dependencies,
+              dependencyOffsets,
+              map,
+            }) => {
               if (!dependencies) {
                 dependencies = this._extractor(code).deps.sync;
               }
-              return {id, code, dependencies, map};
+              return {id, code, dependencies, dependencyOffsets, map, sourceCode};
             });
           }
         });
@@ -188,6 +193,7 @@
   }
 }

+var i = 0;
 function whileInDocBlock(chunk, i, result) {
   // consume leading whitespace
   if (!/\S/.test(result)) {
diff --git a/src/ModuleCache.js b/src/ModuleCache.js
--- a/src/ModuleCache.js
+++ b/src/ModuleCache.js
@@ -3,6 +3,7 @@
 const AssetModule = require('./AssetModule');
 const Package = require('./Package');
 const Module = require('./Module');
+const Polyfill = require('./Polyfill');
 const path = require('fast-path');

 class ModuleCache {
@@ -87,6 +88,17 @@
     return this.getPackage(packagePath);
   }

+  createPolyfill({file}) {
+    return new Polyfill({
+      file,
+      cache: this._cache,
+      depGraphHelpers: this._depGraphHelpers,
+      fastfs: this._fastfs,
+      moduleCache: this,
+      transformCode: this._transformCode,
+    })
+  }
+
   _processFileChange(type, filePath, root) {
     const absPath = path.join(root, filePath);

diff --git a/src/Polyfill.js b/src/Polyfill.js
--- a/src/Polyfill.js
+++ b/src/Polyfill.js
@@ -4,10 +4,10 @@
 const Module = require('./Module');

 class Polyfill extends Module {
-  constructor({ path, id, dependencies }) {
-    super({ file: path });
-    this._id = id;
-    this._dependencies = dependencies;
+  constructor(options) {
+    super(options);
+    this._id = options.id;
+    this._dependencies = options.dependencies;
   }

   isHaste() {
diff --git a/src/__tests__/Module-test.js b/src/__tests__/Module-test.js
--- a/src/__tests__/Module-test.js
+++ b/src/__tests__/Module-test.js
@@ -251,6 +251,19 @@
       });
     });

+    pit('forwards the `dependencyOffsets` property forwarded by `transformCode`', () => {
+      const mockedDependencyOffsets = [12, 764];
+      transformCode.mockReturnValue(Promise.resolve({
+        code: exampleCode,
+        dependencyOffsets: mockedDependencyOffsets,
+      }));
+      const module = createModule({transformCode});
+
+      return module.read().then(({dependencyOffsets}) => {
+        expect(dependencyOffsets).toEqual(mockedDependencyOffsets);
+      });
+    });
+
     pit('exposes the transformed code rather than the raw file contents', () => {
       transformCode.mockReturnValue(Promise.resolve({code: exampleCode}));
       const module = createModule({transformCode});
