You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

80 lines
1.5 KiB

  1. const path = require("path")
  2. const rules = [
  3. { test: /\.(worker\.js)(\?.*)?$/,
  4. use: [
  5. {
  6. loader: "worker-loader",
  7. options: {
  8. inline: true
  9. }
  10. },
  11. { loader: "babel-loader" }
  12. ]
  13. },
  14. { test: /\.(jsx)(\?.*)?$/,
  15. use: [
  16. { loader: "react-hot-loader" },
  17. { loader: "babel-loader" }
  18. ]
  19. },
  20. { test: /\.(css)(\?.*)?$/,
  21. use: [
  22. "style-loader",
  23. "css-loader",
  24. "postcss-loader"
  25. ]
  26. },
  27. { test: /\.(scss)(\?.*)?$/,
  28. use: [
  29. "style-loader",
  30. "css-loader",
  31. {
  32. loader: "postcss-loader",
  33. options: { sourceMap: true }
  34. },
  35. { loader: "sass-loader",
  36. options: {
  37. outputStyle: "expanded",
  38. sourceMap: true,
  39. sourceMapContents: "true"
  40. }
  41. }
  42. ]
  43. }
  44. ]
  45. module.exports = require("./make-webpack-config")(rules, {
  46. _special: {
  47. separateStylesheets: false,
  48. },
  49. devtool: "eval",
  50. entry: {
  51. "swagger-ui-bundle": [
  52. "./src/polyfills",
  53. "./src/core/index.js"
  54. ],
  55. "swagger-ui-standalone-preset": [
  56. "./src/polyfills",
  57. "./src/standalone/index.js",
  58. ]
  59. },
  60. output: {
  61. pathinfo: true,
  62. filename: "[name].js",
  63. library: "[name]",
  64. libraryTarget: "umd",
  65. chunkFilename: "[id].js"
  66. },
  67. devServer: {
  68. port: 3200,
  69. contentBase: path.join(__dirname, "dev-helpers"),
  70. publicPath: "/",
  71. noInfo: true,
  72. hot: true,
  73. stats: {
  74. colors: true
  75. },
  76. },
  77. })