Skip to content

rezof/babel-codemod-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-codemod-example

When ES modules land in Node, it will be impossible to do this:

import {thing} from './common-js-module'

Because CommonJS is not statically analyzable. However many people (myself included) have been doing this for a long time:

import {readFile} from 'fs'

In this quick video, I show you a quick babel plugin I wrote to do a codemod on my code to fix this automatically.

About

An example of how to use babel as a codemod

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%