错误代码:
ERROR in ./app/index.js
Module build failed: Error: C:/Users/wuhan001/WebstormProjects/reduxTest/app/index.js: Invalid mapping: {"generated":{"line":46,"column":153,"lastColumn":null},"source":n
me":null}
at SourceMapGenerator_validateMapping [as _validateMapping] (C:\Users\wuhan001\WebstormProjects\reduxTest\node_modules\source-map\lib\source-map-generator.js:277:13)
at SourceMapGenerator_addMapping [as addMapping] (C:\Users\wuhan001\WebstormProjects\reduxTest\node_modules\source-map\lib\source-map-generator.js:101:12)
at C:\Users\wuhan001\WebstormProjects\reduxTest\node_modules\babel-core\lib\transformation\file\index.js:450:29
at Array.forEach (native)
at SourceMapConsumer_eachMapping [as eachMapping] (C:\Users\wuhan001\WebstormProjects\reduxTest\node_modules\source-map\lib\source-map-consumer.js:155:14)
at C:\Users\wuhan001\WebstormProjects\reduxTest\node_modules\babel-core\lib\transformation\file\index.js:443:26
at File.mergeSourceMap (C:\Users\wuhan001\WebstormProjects\reduxTest\node_modules\babel-core\lib\transformation\file\index.js:468:9)
at File.generate (C:\Users\wuhan001\WebstormProjects\reduxTest\node_modules\babel-core\lib\transformation\file\index.js:659:25)
at File.transform (C:\Users\wuhan001\WebstormProjects\reduxTest\node_modules\babel-core\lib\transformation\file\index.js:518:17)
at C:\Users\wuhan001\WebstormProjects\reduxTest\node_modules\babel-core\lib\transformation\pipeline.js:49:19
@ multi main
webpack配置:
var path = require('path');
var node_modules_dir = path.join(__dirname, 'node_modules');
var deps = [
'react/dist/react.min.js'
];
var config = {
entry: ['webpack-dev-server/client?http://0.0.0.0:8080', // WebpackDevServer host and port
'webpack/hot/only-dev-server', path.resolve(__dirname, './app/index.js')],
resolve: {
alias: {},
extensions: ['', '.js', '.jsx']
},
devtool: 'eval-source-map',
output: {
path: path.resolve(__dirname, './build'),
filename: 'bundle.js'
},
module: {
noParse: [],
loaders: [{
test: /\.js?$/,
exclude: /(node_modules|bower_components)/,
loaders: ['react-hot', 'babel']
}, {
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loaders: ['react-hot', 'babel'],
}, {
test: /\.css$/,
loader: 'style!css'
}, {
test: /\.less$/,
loader: 'style!css!less'
}]
},
devServer: {
contentBase: "./build",
noInfo: true, // --no-info option
hot: true,
inline: true
},
};
deps.forEach(function (dep) {
var depPath = path.resolve(node_modules_dir, dep);
config.resolve.alias[dep.split(path.sep)[0]] = depPath;
config.module.noParse.push(depPath);
});
module.exports = config;
请问解决了?