Created
August 26, 2015 09:49
-
-
Save danhper/aa946233dd71fc2a4a88 to your computer and use it in GitHub Desktop.
Transform CommonJS module import to ES6 syntax
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 var AAA = require('BBB'); into import AAA from 'BBB'; | |
ls $DIR/**/*.js | xargs sed -i -r "s/var (.*?) = require\('(.*?)'\);/import \1 from '\2';/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment