3

process.env.NODE_ENV=='development' - 這是OK!當在process.env.NODE_ENV =='production'時,在IE11.0.9600中使用babel-polyfill取回和標題未定義。

但我們的生產版本在IE 11(11.0.9600)中失敗。 所有鉻做工精細55.

devDependencies:

... 
babel-core: "6.22.0", 
babel-eslint: "^7.0.0", 
babel-loader: "^6.2.5", 
babel-preset-env: "^1.5.2", 
babel-preset-es2015: "^6.16.0", 
babel-preset-es2016: "^6.22.0", 
babel-preset-es2017: "^6.16.0", 
babel-preset-react: "^6.16.0", 
babel-preset-stage-0: "^6.22.0" 
... 

依賴關係:

... 
babel-polyfill: "^6.16.0" 
... 

.babelrc:

{ 
    "presets": [ 
     "react", 
     ["env", { 
      "useBuiltIns": true 
     }], 
     "stage-0" 
    ] 
} 

嘗試"useBuiltIns": false,es2016,ES2015,es2017預設。沒有什麼變化。

index.js:

"use strict"; 
import 'babel-polyfill' 
... 

webpack.config module.exports.entry:

vendor: ['babel-polyfill', 'immutable', 'react', 'react-dom', ...], 
... 
bundle: [path.resolve(__dirname, srcPath + ""index.js)] 

供應商是index.html中的第一個腳本。

鍵入_babelPolyfill in ie console return true。 但頭部,取值未定義...

爲什麼process.env.NODE_ENV=='production'在IE11中打破了我的應用程序? 如何解決我的配置?

回答

相關問題