我收到此错误:
未捕获的类型错误:无法在 esprima.js:12 的 webpackUniversalModuleDefinition (esprima.js:11) 处设置未定义的属性“esprima”
尝试加载 Web 应用程序时:
错误发生在这里:
(function webpackUniversalModuleDefinition(root, factory) {
/* istanbul ignore next */
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
/* istanbul ignore next */
else if(typeof exports === 'object')
exports["esprima"] = factory();
else
root["esprima"] = factory(); // ** => error is thrown here
})(this, function() {
// ...
});
作为参考,该文件webpack.config.js
是:
// webpack.config.js
module.exports = {
entry: {
// import: './src/Three.js'
},
mode: 'production',
output: {
path: __dirname,
publicPath: '/',
filename: './build/three.min.js'
},
devServer: {
watchContentBase: true,
publicPath: "/",
contentBase: "./",
hot: true,
port: 9090,
},
};
谁能提供线索可能出了什么问题?