Skip to content

Instantly share code, notes, and snippets.

@rizwan92
Created May 28, 2018 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rizwan92/212edec5b92151cdec94cc3a69abb1a3 to your computer and use it in GitHub Desktop.
Save rizwan92/212edec5b92151cdec94cc3a69abb1a3 to your computer and use it in GitHub Desktop.
my webpack.config.js file
import webpack from 'webpack';
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry : './client/index.js',
output : {
path : __dirname + '/public',
filename: 'bundle.js',
chunkFilename: '[name].bundle.js',
publicPath : __dirname + '/public',
},
module:{
rules: [
{ test: /\.js$/, use: 'babel-loader',exclude: /node_modules/},
{
test: /(\.css|.scss)$/,
use: [
{
loader: 'style-loader'
},
{
loader: 'file-loader',
options:{
name:'[name].[ext]'
}
},
{
loader: 'css-loader'
},
{
loader: 'sass-loader'
},
]
},
]
},
plugins: [
new ExtractTextPlugin('styles.css'),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment