Open sculove opened 7 years ago
https://github.com/tc39/proposal-dynamic-import Stage3 단계.
Dynamic-import 스펙 추가
import("module").then(module => { // todo }).catch(err => { // err });
동기식
비동기
최상위에서만 import가 가능
Webpack2에서는 이미 지원하고 있음... https://webpack.js.org/guides/code-splitting/#dynamic-imports
참고로, 기존 webpack1에서는 require.ensure를 지원했음 https://webpack.js.org/api/module-methods/#require-ensure
https://github.com/tc39/proposal-dynamic-import Stage3 단계.
Dynamic-import 스펙 추가
동기식
비동기
동기식
.최상위에서만 import가 가능
비동기