This repo is a proof of concept of a simple node script that renders the initial state of a React component to a Drupal 7 .tpl.php
file, meaning crawlers like Googlebot can still index a site accurately without having to implement a full-featured SSR solution.
- Clone this repo.
- Run
npm install
- Run
npm run build
- Run
npm run staticify
- Review the contents of
mytemplate.tpl.php
- Make modifications to
src/index.js
and re-run the above commands to test additional changes in React.