With the help from Failed to transpile arrow functions even I saw "transform-arrow-functions { ie } " from log and I have not exclude /node_modules/ I was able to reproduce this problem and the following are what I found:
- debugjs causes the problem.
- I first used
.babelrc
then babel failed to transpiledebugjs
after I changed it tobabel.config.json
babel can transpiledebugjs
but why ?
- use
.bablerc
instead ofbabel.config.json
, runnpm run bundle
- run
ag --js -c "=>{" ./dist/
orgrep -c "=>{" ./dist/main.js
to check
- use
babel.config.json
for babel 7, refer to https://babeljs.io/docs/config-files#6x-vs-7x-babelrc-loading exclude
setting in webpack.config.js:- Without it, can transpile the code but browsers fail to run
- with it, IE fails to run
- So to make IE and all other evergreen browsers to run, use
exclude: /node_modules\/(?!(debug)\/).*/,
想不到最后居然还是因为debugjs , 从 2019开始我就被它搞,都4年了 😂
- @babel/preset-env fails to polyfill IE11 for debug module, version 4 qiulang opened this issue on Nov 14, 2019
- Failing to load the file in IE qiulang commented on Jun 22, 2021 give up then !
- 现在 。。。