webpack.config.min.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * Created by Jacky.gao on 2016/5/17.
  3. */
  4. var webpack = require('webpack');
  5. var WebpackCleanupPlugin = require('webpack-cleanup-plugin');
  6. module.exports = {
  7. entry: {
  8. frame:'./src/frame/index.jsx',
  9. variableEditor:'./src/variable/index.jsx',
  10. constantEditor:'./src/constant/index.jsx',
  11. parameterEditor:'./src/parameter/index.jsx',
  12. actionEditor:'./src/action/index.jsx',
  13. packageEditor:'./src/package/index.jsx',
  14. flowDesigner:'./src/flow/index.jsx',
  15. ruleSetEditor:'./src/editor/urule/index.jsx',
  16. decisionTableEditor:'./src/editor/decisiontable/index.jsx',
  17. scriptDecisionTableEditor:'./src/editor/scriptdecisiontable/index.jsx',
  18. decisionTreeEditor:'./src/editor/decisiontree/index.jsx',
  19. clientConfigEditor:'./src/client/index.jsx',
  20. ulEditor:'./src/editor/ul/index.jsx',
  21. scoreCardTable:'./src/scorecard/index.jsx',
  22. permissionConfigEditor:'./src/permission/index.jsx'
  23. },
  24. output: {
  25. path: '../urule-console/src/main/resources/urule-asserts/js',
  26. filename: '[name].bundle.js'
  27. },
  28. plugins: [
  29. new webpack.optimize.UglifyJsPlugin({
  30. compress: {
  31. warnings: false
  32. },
  33. output: {
  34. comments: false
  35. }
  36. }),
  37. new webpack.DefinePlugin({
  38. 'process.env':{
  39. 'NODE_ENV': JSON.stringify('production')
  40. }
  41. }),
  42. new WebpackCleanupPlugin()
  43. ],
  44. module: {
  45. loaders: [
  46. {
  47. test: /\.(jsx|js)?$/,
  48. exclude: /(node_modules|bower_components)/,
  49. loader: 'babel',
  50. query: {
  51. presets: ['react', 'es2015'],
  52. compact:true
  53. }
  54. },
  55. {
  56. test: /\.css$/,
  57. loader: "style-loader!css-loader"
  58. },
  59. {
  60. test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
  61. loader: 'url-loader?limit=1000000&name=[name]-[hash].[ext]'
  62. }
  63. ]
  64. }
  65. }