Skip to content

Instantly share code, notes, and snippets.

@fega
Created August 12, 2018 04:46
Show Gist options
  • Save fega/3df957c4cf1347d92dfbbd452a9e0e85 to your computer and use it in GitHub Desktop.
Save fega/3df957c4cf1347d92dfbbd452a9e0e85 to your computer and use it in GitHub Desktop.
Replace al import "" from "" for require in javascript
# time saving when you want to get rid babel.js
regex: import (\w+) from "((\w|\-)+)"; # this will match import export
const $1 = require("$2"); # this will replace them with require
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment