Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

targets 设置ie9 vendors.async.js还有const #2608

Closed
xiaohuoni opened this issue Jun 14, 2019 · 9 comments
Closed

targets 设置ie9 vendors.async.js还有const #2608

xiaohuoni opened this issue Jun 14, 2019 · 9 comments

Comments

@xiaohuoni
Copy link
Member

What happens?

A clear and concise description of what the bug is.

dynamicImport: {
  webpackChunkName: true,
  level: 3,
},
targets:{
  ie:9
}

umi.js 和相应的 p__showDoc__index.async.js 都没有 const 和箭头函数 =>
但是 vendors.async.js 还有const 和箭头函数 =>
image

Context

  • Umi Version:2.7.1
  • Node Version:10.13.0
  • Platform:mac
@xiaohuoni
Copy link
Member Author

先关闭了。

@afc163
Copy link
Contributor

afc163 commented Jun 14, 2019

什么原因?

@xiaohuoni
Copy link
Member Author

@afc163 可能是来自未走 babel 编译的 node_modules

@chenshuai2144
Copy link
Contributor

chenshuai2144 commented Jun 14, 2019

有些库就是死活不用 babel 编译一下。比如 query-string。

@Inori-Lover
Copy link

Inori-Lover commented Aug 6, 2019

    "umi": "^2.6.16",
    "umi-plugin-react": "^1.6.0",

umirc中targets的节选是这样的:

  targets: {
    ie: 9,
    ios: 8,
    chrome: 40,
  },

umi的chunk还是出现了const(只有一处)

产物节选:

sa7a:function(e,t,n){"use strict";function r(e,t){var o=!0,i=!1,a=void 0;try{for(var u,c=e[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){const e=u.value;if(e.routes)return r(e.routes,t);if(n("eO8H").matchPath(t,e))return e}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r}

bundle-analyzer节选:

{"id":"sa7a","label":"findRoute.js","path":"./node_modules/umi-build-dev/lib/findRoute.js","statSize":931,"parsedSize":365,"gzipSize":269}

update:
extraBabelIncludes 加入 /umi-build-dev/ 之后就没出现了,基于这是一个umi套件的原因我觉得可以认为是bug范畴?

@fishenal
Copy link

fishenal commented Sep 5, 2019

有什么解决办法吗

@xiaohuoni
Copy link
Member Author

#1421 (comment)

@xiaohuoni xiaohuoni reopened this Sep 5, 2019
@fishenal
Copy link

fishenal commented Sep 6, 2019

@xiaohuoni

我遇到的问题可能是引用的fabric里引用的jsdom引用的一个库会出现高版本的代码,使用fabric-browserfy就解决了这个问题

@EthanGD
Copy link

EthanGD commented Sep 12, 2019

vendors. async.js 的作用是什麼,我打包後運行服務器報錯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants