Skip to content

Instantly share code, notes, and snippets.

@drejohnson
Created February 25, 2016 21:29
Show Gist options
  • Save drejohnson/f48f53a319cde10b9e1c to your computer and use it in GitHub Desktop.
Save drejohnson/f48f53a319cde10b9e1c to your computer and use it in GitHub Desktop.
Convert require statement to ES2015 import statement
Search:
var\s+(\w+)\s+\=\s+require\((("|')[a-zA-Z0-9\/\.-]+\3)\)\;?
Replace:
import $1 from $2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment