生成的bundle.js跟老师的不一样
来源:20-11 构建工具 - 配置webpack
shiny_jun
2018-04-27
! function (e) {
var n = {};
function r(t) {
if (n[t]) return n[t].exports;
var o = n[t] = {
i: t,
l: !1,
exports: {}
};
return e[t].call(o.exports, o, o.exports, r), o.l = !0, o.exports
}
r.m = e, r.c = n, r.d = function (e, n, t) {
r.o(e, n) || Object.defineProperty(e, n, {
configurable: !1,
enumerable: !0,
get: t
})
}, r.r = function (e) {
Object.defineProperty(e, "__esModule", {
value: !0
})
}, r.n = function (e) {
var n = e && e.__esModule ? function () {
return e.default
} : function () {
return e
};
return r.d(n, "a", n), n
}, r.o = function (e, n) {
return Object.prototype.hasOwnProperty.call(e, n)
}, r.p = "", r(r.s = 0)
}([function (e, n) {
console.log("100")
}]);但在运行npm start时候有这么一个提示

然后我输入yes,生成的bundle.js文件如上。
我还试过选择no,报错如下:

写回答
2回答
-
Shirley99
2019-01-21
你可能还需要在webpack.config.js的module.export下设置mode: 'development',这是git里面会提示的警告内容
00 -
双越
2018-04-27
选择 yes 生成的 bundle.js 没错,你可以运行试试
042018-04-28
相似问题