Lets have a look at the simplest setup you can create for your application. Use a single bundle when:
让我们看一下为应用创建的最简单的配置,只有在下面的情况下才使用单入口模式:
webpack.production.config.js
var path = require('path');
var config = {
entry: path.resolve(__dirname, 'app/main.js'),
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel'
}]
}
};
module.exports = config;