Guest User

Untitled

a guest
Apr 6th, 2018
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. const path = require('path');
  2. const HtmlWebpackPlugin = require('html-webpack-plugin');
  3. const CleanWebpackPlugin = require('clean-webpack-plugin');
  4. const MiniCssExtractPlugin = require("mini-css-extract-plugin");
  5. const webpack = require('webpack');
  6. const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
  7. module.exports = {
  8. entry: {
  9. output: ['css-hot-loader/hotModuleReplacement', './src/index.js']
  10. },
  11. devtool: 'inline-source-map',
  12. devServer: {
  13. contentBase : './dist',
  14. historyApiFallback : true,
  15. inline : true,
  16. hot : true
  17. },
  18. module : {
  19. rules : [
  20. {
  21.  
  22. test : /\.less$/,
  23. use: [ "style-loader", "css-hot-loader", MiniCssExtractPlugin.loader, "css-loader", 'less-loader']
  24. }/*,
  25. {
  26. test: /\.js$/,
  27. exclude: /node_modules/,
  28. loader: "babel-loader"
  29. }*/
  30. ]
  31. },
  32. plugins: [
  33. new MiniCssExtractPlugin("styles.css"),
  34. new webpack.NamedModulesPlugin(),
  35. new webpack.HotModuleReplacementPlugin(),
  36. new BrowserSyncPlugin({
  37. host : 'localhost',
  38. port : 3000,
  39. proxy: 'http://localhost:8080/'
  40. },{
  41. reload: false
  42. })
  43. ],
  44. output: {
  45. filename: 'bundle.js',
  46. path: path.resolve(__dirname, 'dist')
  47. }
  48. };
Advertisement
Add Comment
Please, Sign In to add comment