Skip to content

Instantly share code, notes, and snippets.

@robinpokorny
Created March 2, 2018 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robinpokorny/5197b0f633f7bb7bcdc9f95d9acf98ef to your computer and use it in GitHub Desktop.
Save robinpokorny/5197b0f633f7bb7bcdc9f95d9acf98ef to your computer and use it in GitHub Desktop.
Babel transform export all file-level variables
const length = 4

const duplicate = (n) => 2 * n

class Foo {}

export default (n) => duplicate(n) + length

into

export const length = 4

export const duplicate = (n) => 2 * n

export class Foo {}

export default (n) => duplicate(n) + length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment