Skip to content

jonearley/gatsby-plugin-stencil

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

gatsby-plugin-stencil

Gatsby server side rendering for your Stencil web components.

Install

npm install --save gatsby-plugin-stencil

How to use

Note: Make sure you you have added the dist-hydrate-script as output target to your Stencil library

Add the plugin to your gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-stencil`,
      options: {
        // The module of your components (required), eg "@ionic/core".
        // Add multiple modules by using an array eg ["@ionic/core", "my-stencil-components"]
        module: "your-stencil-components-package",

        // Stencil renderToString options (optional): https://stenciljs.com/docs/hydrate-app#configuration-options
        renderToStringOptions: {
          prettyHtml: true,
        },
        // Number of workers to spin up (optional). Will default to half the number of CPUs detected via os.cpus()
        numberOfWorkers: 4,
        // Number of files to pass to each worker (optional). Will default to 100
        workerChunkSize: 100,
      },
    },
  ],
};

About

A Gatsby plugin to server side render your Stencil web components.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published