Created
May 28, 2018 09:10
-
-
Save rizwan92/212edec5b92151cdec94cc3a69abb1a3 to your computer and use it in GitHub Desktop.
my webpack.config.js file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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