错误:
我正在使用React + Redux + Webpack + Babel。在vendor.js中获取错误。我试图编辑并提交,然后出现了新的错误。
我将我的软件包更新到最新版本,除了eslint,构建和运行,在lodash中出现了另一个错误
以前有人遇到过这个问题吗?这是生产模式下的web包配置文件。
export default {
debug: true,
devtool: 'source-map', // more info:https://webpack.github.io/docs/build-performance.html#sourcemaps and https://webpack.github.io/docs/configuration.html#devtool
noInfo: true, // set to false to see a list of every file being bundled.
entry: {
main: [
'babel-polyfill',
'./src/bootstrap'
],
vendor: [
'classnames',
'immutable',
'react',
'react-dom',
'react-redux',
'react-router',
'react-router-redux',
'redux',
'redux-actions',
'redux-form',
'redux-immutable',
'redux-saga',
'react-swipeable',
'react-waypoint',
'react-addons-css-transition-group'
],
},
target: 'web', // necessary per https://webpack.github.io/docs/testing.html#compile-and-test
output: {
path: `${__dirname}/dist`,
publicPath: `${config.STATIC_PREFIX}`,
filename: '[name].[chunkhash].js'
},
plugins: [
new WebpackMd5Hash(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin(GLOBALS), // Tells React to build in prod mode. https://facebook.github.io/react/downloads.html
new ExtractTextPlugin('[name].[contenthash].css'),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.CommonsChunkPlugin('vendor', '[name].[chunkhash].js'),
new webpack.optimize.UglifyJsPlugin(),
new VendorChunkPlugin('vendor'),
new AssetsPlugin({
path: __dirname,
filename: 'assets.json',
fullPath: false
}),
new HtmlWebpackPlugin({
template: 'views/index.pug',
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true
},
inject: true,
oneapm: config.oneapm,
}),
],
module: {
loaders: [{
test: /\.jsx?$/,
include: path.join(__dirname, 'src'),
loaders: ['babel', 'eslint']
}, {
test: /\.(ico|jpe?g|png|gif|woff|woff2|svg|eot|ttf)\??.*$/,
loader: 'url-loader?limit=1000&name=[path][name].[hash].[ext]'
}, {
test: /\.json$/,
loaders: ['json']
}, {
test: /(\.css)$/,
loader: ExtractTextPlugin.extract('css?minimize!postcss')
}, {
test: /\.pug$/,
loader: 'pug'
}]
},
postcss: [precss, calc, autoprefixer]
};