Skip to content

Instantly share code, notes, and snippets.

@PierreCavalet
Last active May 24, 2019 07:58
Show Gist options
  • Save PierreCavalet/bae31c17ac815fb58e4944c701dc344b to your computer and use it in GitHub Desktop.
Save PierreCavalet/bae31c17ac815fb58e4944c701dc344b to your computer and use it in GitHub Desktop.
dynamic import
// module.js
const test = 'test'
export default test
// static.js
import test from './test'
console.log(test)
// dynamic.js
import('./test').then(({default: test}) => {
console.log(test)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment