webpack.config.min.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. * Created by Jacky.Gao on 2018-04-23.
  3. * Base on Webpack4
  4. */
  5. const path=require('path');
  6. const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
  7. module.exports={
  8. mode:'production',
  9. entry: {
  10. frame:'./src/frame/index.jsx',
  11. variableEditor:'./src/variable/index.jsx',
  12. constantEditor:'./src/constant/index.jsx',
  13. parameterEditor:'./src/parameter/index.jsx',
  14. actionEditor:'./src/action/index.jsx',
  15. packageEditor:'./src/package/index.jsx',
  16. flowDesigner:'./src/flow/index.jsx',
  17. ruleSetEditor:'./src/editor/urule/index.jsx',
  18. decisionTableEditor:'./src/editor/decisiontable/index.jsx',
  19. scriptDecisionTableEditor:'./src/editor/scriptdecisiontable/index.jsx',
  20. decisionTreeEditor:'./src/editor/decisiontree/index.jsx',
  21. clientConfigEditor:'./src/client/index.jsx',
  22. ulEditor:'./src/editor/ul/index.jsx',
  23. scoreCardTable:'./src/scorecard/index.jsx',
  24. permissionConfigEditor:'./src/permission/index.jsx'
  25. },
  26. output:{
  27. path:path.resolve('../urule-console/src/main/resources/urule-asserts/js'),
  28. filename:'[name].bundle.js'
  29. },
  30. plugins:[
  31. new UglifyJsPlugin(
  32. {
  33. uglifyOptions: {
  34. warnings: false,
  35. output: {
  36. comments: false
  37. },
  38. compress: {
  39. drop_console: true
  40. }
  41. }
  42. }
  43. )
  44. ],
  45. module:{
  46. rules:[
  47. {
  48. test: /\.(jsx|js)?$/,
  49. exclude: /node_modules/,
  50. loader: "babel-loader",
  51. options:{
  52. "presets": [
  53. "react","env"
  54. ]
  55. }
  56. },
  57. {
  58. test:/\.css$/,
  59. use: [{ loader: 'style-loader' }, { loader: 'css-loader' }]
  60. },
  61. {
  62. test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
  63. use: [
  64. {
  65. loader: 'url-loader',
  66. options: {
  67. limit: 10000000
  68. }
  69. }
  70. ]
  71. }
  72. ]
  73. }
  74. };