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.
 
 
 
 

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