Personal Dashboard

webpack.config.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. var ExtractTextPlugin = require('extract-text-webpack-plugin')
  2. module.exports = {
  3. entry: [
  4. 'webpack-dev-server/client?http://localhost:8080',
  5. 'webpack/hot/only-dev-server',
  6. './src/index.js',
  7. ],
  8. output: {
  9. path: __dirname + '/dist',
  10. publicPath: '/',
  11. filename: 'bundle.js'
  12. },
  13. module: {
  14. loaders: [
  15. {
  16. test: /\.jsx?$/,
  17. exclude: /node_modules/,
  18. loader: 'react-hot-loader!babel-loader'
  19. },
  20. {
  21. test: /\.s?css$/,
  22. loader: ExtractTextPlugin.extract({
  23. fallback: 'style-loader',
  24. use: ['css-loader', 'sass-loader']
  25. })
  26. },
  27. {
  28. test: /\.(eot|svg|ttf|woff|woff2)$/,
  29. loader: 'file-loader?name=fonts/[name].[ext]'
  30. }
  31. ]
  32. },
  33. resolve: {
  34. extensions: ['*', '.js', '.jsx']
  35. },
  36. plugins: [
  37. new ExtractTextPlugin({ filename: 'style.css', allChunks: true })
  38. ],
  39. devServer: {
  40. contentBase: './dist',
  41. hot: true,
  42. historyApiFallback: true
  43. },
  44. }