【发布时间】:2018-03-16 11:28:41
【问题描述】:
开发模式下webpack4 bootstarp的代码。
/******/ (function(modules) { // webpackBootstrap
...
/******/ function hotCreateRequire(moduleId) {
/******/ var me = installedModules[moduleId];
/******/ if (!me) return __webpack_require__;
/******/ var fn = function(request) {
/******/ if (me.hot.active) {
/******/ if (installedModules[request]) {
// here use 'includes' not supported in es5
/******/ if (!installedModules[request].parents.includes(moduleId))
而且我的开发环境不是chrome,不支持这些新功能。
那么我该如何解决呢?
或者我必须使用 webpack3?
【问题讨论】:
-
Array.prototype.includes - not transformed with babel 的可能副本 - 你需要一个 polyfill。
-
代码是webpack生成的,不是我的业务代码。并且使用 webpack3,它可以无错误地运行。