我正在尝试将我的开发反应应用程序与webpack捆绑在一起,但生成的捆绑包会抛出错误
Uncaught TypeError: Cannot read property '.js' of undefined
引发此错误的代码是
function hookExtensions(_exts) {
/*istanbul ignore next*/(0, _each2.default)(oldHandlers, function (old, ext) {
if (old === undefined) {
delete (void 0)[ext];
} else {
(void 0)[ext] = old;
}
});
oldHandlers = {};
/*istanbul ignore next*/(0, _each2.default)(_exts, function (ext) {
oldHandlers[ext] = (void 0)[ext];//error is thrown on this line
registerExtension(ext);
});
}
我的webpack.config.js如下:
'use strict';
const path = require('path');
console.log(__dirname);
let config = {
target:'electron-renderer',
entry:'./app/Initializer',
output:{
path:path.resolve(__dirname, 'dist'),
filename: 'appbundle.js',
publicPath:'/dist/'
},
resolve: {
extensions:["",".js",".jsx",".json"]
},
module: {
loaders:[{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.json/,
loader: 'json-loader',
}
],
},
}
module.exports = config;
我可能做错了什么?对此有任何帮助表示赞赏。