MCPcopy Create free account
hub / github.com/tomchentw/react-google-maps / getComponentPathLine

Function getComponentPathLine

styleguide.config.js:8–15  ·  view source on GitHub ↗
(componentPath)

Source from the content-addressed store, hash-verified

6 showUsage: true,
7 showCode: true,
8 getComponentPathLine(componentPath) {
9 const name = path.basename(componentPath, ".jsx")
10 const dirname = path.basename(path.dirname(componentPath))
11 if (dirname === "components") {
12 return `import { ${name} } from "react-google-maps";`
13 }
14 return `import ${name} from "react-google-maps/lib/components/${dirname}/${name}";`
15 },
16 dangerouslyUpdateWebpackConfig(webpackConfig, env) {
17 // WARNING: inspect Styleguidist Webpack config before modifying it, otherwise you may break Styleguidist
18 webpackConfig.resolve.alias["react-google-maps/lib"] = path.resolve("./src")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected