javascript - react webpack.config.js 文件都声明了哪些内容
本文介绍了javascript - react webpack.config.js 文件都声明了哪些内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
var path = require('path')
var webpack = require('webpack')
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'./index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin()
],
module: {
loaders: [
{
test: /\.js$/,
loaders: [ 'babel' ],
exclude: /node_modules/,
include: __dirname
},
{
test: /\.css?$/,
loaders: [ 'style', 'raw' ],
include: __dirname
}
]
}
}
求大手给解释下这个配置文件都写了些什么东东,完全不理解!!
解决方案
这篇关于javascript - react webpack.config.js 文件都声明了哪些内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文