1
0
mirror of https://github.com/mgerb/react-starter synced 2026-03-05 06:15:24 +00:00
This commit is contained in:
2016-12-29 15:50:14 -06:00
committed by Mitchell Gerber
commit 0afda65c45
22 changed files with 788 additions and 0 deletions

52
webpack.config.js Normal file
View File

@@ -0,0 +1,52 @@
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: {
app: './app/app.js',
vendor: ['react', 'react-dom']
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js'
},
module: {
rules: [{
test: /\.(js|jsx)$/,
loaders: ['babel-loader']
}, {
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader!postcss-loader!sass-loader'
})
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader'
})
}]
},
plugins: [
new CleanWebpackPlugin(['dist'], {
verbose: true
}),
new ExtractTextPlugin({
filename: '[name].css',
disable: false,
allChunks: true
}),
new HtmlWebpackPlugin({
filename: 'index.html',
template: './index.html'
}),
new webpack.optimize.CommonsChunkPlugin({
name: ['vendor', 'manifest'],
minChunks: 'Infinity'
})
]
};