examples/with-decorators/README.md
create-docz-appnpx create-docz-app docz-app-with-decorators --example with-decorators
# or
yarn create docz-app docz-app-with-decorators --example with-decorators
curl https://codeload.github.com/doczjs/docz/tar.gz/main | tar -xz --strip=2 docz-main/examples/with-decorators
mv with-decorators docz-with-decorators-example
cd docz-with-decorators-example
To add decorator support, we create a gatsby-node.js in the root directory and inside configure babel to understand decorators :
exports.onCreateBabelConfig = ({ actions }) => {
actions.setBabelPlugin({
name: `@babel/plugin-proposal-decorators`,
options: { legacy: true },
})
}
And add @babel/plugin-proposal-decorators as a dev dependency
yarn add -D @babel/plugin-proposal-decorators
And last we set "compilerOptions.experimentalDecorators" to true in jsconfig.json
yarn # npm i
yarn dev # npm run dev
yarn build # npm run build
yarn serve # npm run serve