webpack.common.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. const path = require('path');
  2. const HtmlWebpackPlugin = require('html-webpack-plugin')
  3. module.exports = {
  4. entry: {
  5. contact: './src/contact/index.js',
  6. framework: ['react','react-dom'],
  7. staff:'./src/staff/index.js',
  8. workbench:'./src/workbench/index.js',
  9. },
  10. output: {
  11. filename: 'js/bundle.js',
  12. path: path.resolve(__dirname, '../dist')
  13. },
  14. module: {
  15. rules: [
  16. {
  17. test: /\.(js|jsx)$/,
  18. use: 'babel-loader',
  19. exclude: /node_modules/,
  20. },
  21. // {
  22. // test: /\.css$/,
  23. // use: [
  24. // {
  25. // loader:'style-loader',
  26. // options:{
  27. // insert:'top'
  28. // }
  29. // },
  30. // 'css-loader'],
  31. // },
  32. // {
  33. // test: /\.(eot|woff)$/, loader: "file-loader"
  34. // }
  35. ]
  36. },
  37. plugins: [
  38. new HtmlWebpackPlugin({
  39. template: 'public/sub_index.html',
  40. filename: 'contact/contact.html',
  41. chunks:['contact','framework']
  42. }),
  43. new HtmlWebpackPlugin({
  44. template: 'public/sub_index.html',
  45. filename: 'staff/staff.html',
  46. chunks:['staff','framework']
  47. }),
  48. ]
  49. }