@mathieudutour/prodo-gatsby-plugin

0.0.5 • Public • Published

@prodo/gatsby-plugin

A Gatsby plugin for Prodo with built-in server-side rendering support.

Install

npm install --save @prodo/core @prodo/babel-plugin @prodo/gatsby-plugin

How to use

Edit gatsby-config.js

const path = require(`path`);

module.exports = {
  plugins: [
    {
      resolve: `@prodo/gatsby-plugin`,
      options: {
        model: path.join(__dirname, `path/to/model.ts`), // absolute path to the model
        exportName: `model`, // optional name of the model export
        storeConfig: {
          // initial store configuration
          initState: {
            loadingUser: false,
          },
          initLocal: {
            user: null,
          },
        },
      },
    },
  ],
};

Options

  • model - String required: Absolute path to the file containing the Prodo model
  • exportName - String optional: Name of the model export. Defaults to model. If the model is the default export, use default.
  • storeConfig - Any: Object passed as an argument to model.createStore().

Package Sidebar

Install

npm i @mathieudutour/prodo-gatsby-plugin

Weekly Downloads

5

Version

0.0.5

License

MIT

Unpacked Size

6.08 kB

Total Files

9

Last publish

Collaborators

  • mathieudutour