doczjs / docz

✍ It has never been so easy to document your things!
https://docz.site
MIT License
23.67k stars 1.46k forks source link

Confusion about the right way to start develop server and build docz website #1533

Open Ayase-252 opened 4 years ago

Ayase-252 commented 4 years ago

Question

I'm a bit confused on how to develop and build a docz website with gatsby. According to document, yarn docz dev or yarn docz build should be used to start a developing server and build production version respectively. Howerver, in example, it seems to use gastby develop and gastby build for development and build respectively.

I tried both methods. If I use yarn docz dev, it ends up a weird webpack error:

Generating development JavaScript bundle failed

unknown: Identifier '_frontmatter' has already been declared (139:13)

  137 | MDXContent.isMDXComponent = true;
  138 | 
> 139 | export const _frontmatter = {};
      |              ^
  140 | 

File: ../docs/index.mdx:139:13

If I use gatsby develop, it do not reflect the configration on doczrc.js. As you can see with config

// doczrc.js
export default {
  gatsbyRemarkPlugins: [
    {
      resolve: "gatsby-remark-vscode",
      // OPTIONAL
      options: {},
    },
  ],
  // it should enable dark mode in default.
  themeConfig: {
    mode: "dark"
  }
}

light mode is still default when open localhost:8000. 截屏2020-06-22下午3 47 31

There is the demo repository. I'm not certain about where I did wrong. Wrong project configration, wrong commands to use? What is the preferred way to start and build? Thank you.

adamkudrna commented 4 years ago

A few things to note: