this is my webpack config for one of my projects, with this config, you should be able to generate css and js files.
And it should be enough for any project.
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: [
'babel-regenerator-runtime',
path.resolve(__dirname, 'src')
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/'
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
WEBPACK: true
}
}),
new ExtractTextPlugin({
filename: 'index.css',
disable: false,
allChunks: true
}),
new webpack.optimize.UglifyJsPlugin()
],
resolve: {
extensions: ['.js', '.json', '.jsx'],
},
module: {
loaders: [
{
test: /\.jsx?/,
use: {
loader: 'babel-loader'
},
include: path.resolve(__dirname, 'src'),
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [{
loader: 'css-loader',
options: {
minimize: true
}
}, {
loader: 'sass-loader',
options: {
minimize: true
}
}]
})
},
{ test: /\.(png|jpg|jpeg|gif|ico)$/, loader: 'url-loader' },
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file-loader' },
{ test: /\.(woff|woff2)$/, loader: 'url-loader?prefix=font/&limit=5000' },
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=application/octet-stream'
},
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=image/svg+xml' }
]
}
};