dev.babel.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * @prettier
  3. */
  4. import path from "path"
  5. import { HotModuleReplacementPlugin } from "webpack"
  6. import configBuilder from "./_config-builder"
  7. import styleConfig from "./stylesheets.babel"
  8. const devConfig = configBuilder(
  9. {
  10. minimize: false,
  11. mangle: false,
  12. sourcemaps: true,
  13. includeDependencies: true,
  14. },
  15. {
  16. mode: "development",
  17. entry: {
  18. "swagger-ui-bundle": [
  19. "./src/core/index.js",
  20. ],
  21. "swagger-ui-standalone-preset": [
  22. "./src/standalone/index.js",
  23. ],
  24. "swagger-ui": "./src/style/main.scss",
  25. },
  26. performance: {
  27. hints: false
  28. },
  29. output: {
  30. library: "[name]",
  31. filename: "[name].js",
  32. chunkFilename: "[id].js",
  33. },
  34. devServer: {
  35. port: 3200,
  36. publicPath: "/",
  37. disableHostCheck: true, // for development within VMs
  38. stats: {
  39. colors: true,
  40. },
  41. hot: true,
  42. contentBase: path.join(__dirname, "../", "dev-helpers"),
  43. host: "0.0.0.0",
  44. },
  45. plugins: [new HotModuleReplacementPlugin()],
  46. }
  47. )
  48. // mix in the style config's plugins and loader rules
  49. devConfig.plugins = [...devConfig.plugins, ...styleConfig.plugins]
  50. devConfig.module.rules = [
  51. ...devConfig.module.rules,
  52. ...styleConfig.module.rules,
  53. ]
  54. export default devConfig