Personal Dashboard

webpack.config.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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: ['sass-loader', 'css-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. },
  43. };