mirror of
https://github.com/mgerb/react-starter
synced 2026-03-05 06:15:24 +00:00
init
This commit is contained in:
52
webpack.config.js
Normal file
52
webpack.config.js
Normal 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'
|
||||
})
|
||||
]
|
||||
};
|
||||
Reference in New Issue
Block a user