Geeks With Blogs
AngelEyes on .Net Tips, tricks and WTFs about Asp .Net, SQL Server and the likes. RegEx
(JS) Regular Expression to replace "require" statements with "import statements"
Having dabbled a bit with React / Redux, and while doing so used both the Import statement from ES6 and the Require function of Browserify, I decided I needed a RegEx to replace all "require" lines to "import" lines.
This is what I came up wit, so far:


and replace  with;

import $1 from '$2';

Posted On Monday, November 23, 2015 1:15 PM

Copyright © AngelEyes | Powered by: