tc39 / proposal-dynamic-import

import() proposal for JavaScript

Home Page:https://tc39.github.io/proposal-dynamic-import/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dynamic-import in IE

chiaweilee opened this issue · comments

commented

I am using dynamic-import..it worked..
But, when I build prod...something happened in IE.

I used it like this:

import(/* webpackChunkName: "lang-[request]" */ `@/lang/${lang}`).then()

after build prod:

s=function(t){n("Trjk")(`./${t}`).then()

IE can not regonize ``

How to avoid this problem?

@chiaweilee That seems to be an issue with your build system, not with this proposal.

This is not an issue with this proposal but with IE. It is most likely related to your transpiler. Make sure to configure it to emit ES5 code or lower. (template strings with ` were introduced in ES6)