forked from tomchentw/react-google-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
styleguide.config.js
65 lines (64 loc) · 1.63 KB
/
styleguide.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const _ = require("lodash")
const path = require("path")
module.exports = {
styleguideDir: "docs",
showUsage: true,
showCode: true,
getComponentPathLine(componentPath) {
const name = path.basename(componentPath, ".jsx")
const dirname = path.basename(path.dirname(componentPath))
if (dirname === "components") {
return `import { ${name} } from "react-google-maps";`
}
return `import ${name} from "react-google-maps/lib/components/${dirname}/${name}";`
},
dangerouslyUpdateWebpackConfig(webpackConfig, env) {
// WARNING: inspect Styleguidist Webpack config before modifying it, otherwise you may break Styleguidist
webpackConfig.resolve.alias["react-google-maps/lib"] = path.resolve("./src")
webpackConfig.resolve.alias["react-google-maps"] = path.resolve("./src")
return webpackConfig
},
styles: {
Playground: {
preview: {
height: 400 + 2 * 16 + 2 * 1,
},
},
},
sections: [
{
name: "Introduction",
content: "src/docs/introduction.md",
},
{
name: "Documentation",
sections: [
{
name: "Installation",
content: "src/docs/installation.md",
},
{
name: "Usage & Configuration",
content: "src/docs/configuration.md",
},
],
},
{
name: "HOCs",
sections: [
{
name: "withGoogleMap",
content: "src/withGoogleMap.md",
},
{
name: "withScriptjs",
content: "src/withScriptjs.md",
},
],
},
{
name: "UI Components",
components: "src/components/**/*.jsx",
},
],
}