styleguide.config.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* eslint import/no-extraneous-dependencies: 0 */
  2. const path = require("path");
  3. const { createConfig, babel, css, devServer } = require("webpack-blocks");
  4. // https://react-styleguidist.js.org/docs/configuration.html
  5. module.exports = {
  6. title: "react-dropzone",
  7. styleguideDir: path.join(__dirname, "styleguide"),
  8. template: {
  9. favicon:
  10. "https://github.com/react-dropzone/react-dropzone/raw/master/logo/logo.png",
  11. },
  12. webpackConfig: createConfig([
  13. babel(),
  14. css(),
  15. devServer({
  16. disableHostCheck: true,
  17. host: "0.0.0.0",
  18. }),
  19. ]),
  20. exampleMode: "expand",
  21. usageMode: "expand",
  22. showSidebar: true,
  23. serverPort: 8080,
  24. moduleAliases: {
  25. "react-dropzone": path.resolve(__dirname, "./src"),
  26. },
  27. require: [path.join(__dirname, "examples/theme.css")],
  28. sections: [
  29. {
  30. name: "",
  31. content: "README.md",
  32. },
  33. // TODO: Figure out how to document the hook
  34. // See https://github.com/reactjs/react-docgen/issues/332
  35. {
  36. name: "Components",
  37. components: "./src/index.js",
  38. },
  39. {
  40. name: "Examples",
  41. sections: [
  42. {
  43. name: "Basic example",
  44. content: "examples/basic/README.md",
  45. },
  46. {
  47. name: "Event Propagation",
  48. content: "examples/events/README.md",
  49. },
  50. {
  51. name: "Styling Dropzone",
  52. content: "examples/styling/README.md",
  53. },
  54. {
  55. name: "Accepting specific file types",
  56. content: "examples/accept/README.md",
  57. },
  58. {
  59. name: "Accepting specific number of files",
  60. content: "examples/maxFiles/README.md",
  61. },
  62. {
  63. name: "Custom validation",
  64. content: "examples/validator/README.md",
  65. },
  66. {
  67. name: "Opening File Dialog Programmatically",
  68. content: "examples/file-dialog/README.md",
  69. },
  70. {
  71. name: "Previews",
  72. content: "examples/previews/README.md",
  73. },
  74. {
  75. name: "Class Components",
  76. content: "examples/class-component/README.md",
  77. },
  78. {
  79. name: "No JSX",
  80. content: "examples/no-jsx/README.md",
  81. },
  82. {
  83. name: "Extending Dropzone",
  84. content: "examples/plugins/README.md",
  85. },
  86. ],
  87. },
  88. {
  89. name: "Integrations",
  90. sections: [
  91. {
  92. name: "Pintura",
  93. content: "examples/pintura/README.md",
  94. },
  95. ],
  96. },
  97. ],
  98. };