Created
November 6, 2017 20:41
-
-
Save antonioiksi/af669122c2f62d3636f2c6220cd93010 to your computer and use it in GitHub Desktop.
replace require with import and vv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The syntax for importing a member of a module with an aliased name is: | |
import {key as foo} from 'bar'; | |
This is equivalent to var foo = require('bar').key; | |
If you want to import a member without aliasing it, the syntax is simpler: | |
import {foo} from 'bar'; | |
Is equivalent to: | |
var foo = require('bar').foo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment