webpack.config.js 744 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. const path = require('path');
  2. const HtmlWebpackPlugin = require('html-webpack-plugin');
  3. const webpack = require('webpack');
  4. module.exports = {
  5. entry:'./src/index.js',
  6. output:{
  7. filename: "main.js",
  8. path:path.resolve(__dirname, 'dist'),
  9. publicPath:'/'
  10. },
  11. mode:'development',
  12. devtool: 'inline-source-map',
  13. devServer: {
  14. contentBase: './dist',
  15. proxy:{
  16. '/api':'http://192.168.2.236:5050'
  17. },
  18. hot: true
  19. },
  20. plugins: [
  21. new HtmlWebpackPlugin({
  22. title: 'Output Management'
  23. })
  24. ],
  25. module: {
  26. rules: [
  27. {
  28. test: /\.js$/,
  29. use: "imports-loader?$=jquery"
  30. },
  31. {
  32. test:/\.less/,
  33. use:['style-loader','css-loader','less-loader']
  34. }
  35. ]
  36. }
  37. }