gpt4 book ai didi

网页包 2 "exports is not defined"

转载 作者:行者123 更新时间:2023-12-04 18:27:58 25 4
gpt4 key购买 nike

我刚刚更新到 Webpack 2 并收到运行时错误 exports is not defined在浏览器中。我从这里更改了我的 .babelrc:

{
"plugins": [
"syntax-flow",
"transform-flow-strip-types",
"add-module-exports"
],
"presets": [
"latest",
"stage-2"
]
}

对此:
{
"plugins": [
"syntax-flow",
"transform-flow-strip-types",
"add-module-exports"
],
"presets": [
["latest", {
"es2015": {
"modules": false
}
}],
"stage-2"
]
}

停用模块导入/导出转译并利用 webpack 2 的 tree-shaking 功能。我错过了什么吗?构建正确编译,但在浏览器中它只是爆炸。

最佳答案

TL;DR) 摆脱 add-module-exports

要了解更多关于正在发生的事情:https://ntucker.true.io/ntucker/webpack-2-uncaught-referenceerror-exports-is-not-defined/

关于网页包 2 "exports is not defined",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42040563/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com