Last active
January 9, 2016 05:22
-
-
Save dantman/e4f2971af0ec9236ce11 to your computer and use it in GitHub Desktop.
Transform modules using regenerator-runtime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.transform(transformTools.makeStringTransform( | |
'regenerator-runtimeify', | |
{jsFilesOnly: true}, | |
(contents, transformOptions, done) => { | |
if ( contents.includes('regeneratorRuntime') ) { | |
contents = contents.replace( | |
/(['"']use strict['"'];?\n?)/, | |
"$1\nvar regeneratorRuntime = require('regenerator/runtime');\n"); | |
} | |
done(null, contents); | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment