Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. const HtmlWebpackPlugin = require('html-webpack-plugin')
  2. const {HotModuleReplacementPlugin} = require('webpack')
  3.  
  4. const path = require('path');
  5.  
  6. module.exports = {
  7. mode:'development',
  8. entry:{
  9. client:[
  10. "babel-polyfill",
  11. "./src/client"
  12. ]
  13. },
  14. output:{
  15. filename:"[name].bundle.js",
  16. path:path.resolve(process.cwd(), "dist", "client")
  17. },
  18. devtool:"inline-source-map",
  19. devServer:{
  20. hot:true,
  21. open:true,
  22. port:8080,
  23. historyApiFallback:true,
  24. },
  25. module:{
  26. rules:[
  27. {
  28. exclude: /node_modules/,
  29. use: "babel-loader",
  30. test: /.(js|jsx)$/,
  31. }
  32. ]
  33. },
  34. plugins:[
  35. new HotModuleReplacementPlugin(),
  36. new HtmlWebpackPlugin({
  37. template:path.resolve(process.cwd(),"src","client","public","index.html")
  38. })
  39. ],
  40. resolve: {
  41. extensions: ['.js', '.jsx']
  42. },
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement