Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //regex for locating & replacing ES6 import/export syntax with commonJS require syntax.
- //this is not comprehensive. Used in a very basic scenario.
- //find: import ([a-zA-Z\_\-]{1,}) from '([a-zA-Z0-9\.\/\-]{1,})'
- //replace: let $1 = require('$2')
- //find: export default
- //replace: module.exports =
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement