webpack.build.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Password Management Servlets (PWM)
  3. * http://www.pwm-project.org
  4. *
  5. * Copyright (c) 2006-2009 Novell, Inc.
  6. * Copyright (c) 2009-2018 The PWM Project
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. var commonConfig = require('./webpack.common.js');
  23. var webpack = require('webpack');
  24. var webpackMerge = require('webpack-merge');
  25. module.exports = webpackMerge(commonConfig, {
  26. devtool: 'source-map',
  27. entry: {
  28. 'peoplesearch.ng': './src/main',
  29. 'changepassword.ng': './src/pages/changepassword/changepassword.module',
  30. 'configeditor.ng': './src/pages/configeditor/configeditor.module',
  31. 'helpdesk.ng': './src/helpdesk/main'
  32. },
  33. module: {
  34. loaders: [
  35. {
  36. test: /icons\.json$/,
  37. loaders: [
  38. 'ignore',
  39. // Need to output to an external file, since fontgen consolidates: "../.." into: "../", even after
  40. // doing the string-replace below. This is a problem, since we're loading from a webjar now.
  41. 'file?name=fonts.css',
  42. // This replaces path from app root so the urls are relative to the output directory
  43. 'string-replace?search=url%5C("%5C/&replace=url("./&flags=gm',
  44. 'fontgen?fileName=fonts/[fontname]-[hash][ext]'
  45. ]
  46. }
  47. ]
  48. },
  49. plugins: [
  50. new webpack.optimize.UglifyJsPlugin({
  51. compress: { warnings: false },
  52. comments: false,
  53. sourceMap: true
  54. })
  55. ]
  56. });