Last active
January 12, 2017 01:34
-
-
Save Makio64/efa5be5de80f114253328ed525c4e939 to your computer and use it in GitHub Desktop.
regex to find the old way to require files & import it in the new way
This file contains hidden or 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
| \S*\s+(\S*)\s*=[ ]*require\(\s*["'](.*)["']\s*\)\s*;? | |
| import $1 from '$2' | |
| before: | |
| const bouboup = require( 'blabla/bouboup' ) | |
| after: | |
| import bouboup from 'blabla/bouboup' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment