Created
December 16, 2020 18:42
-
-
Save efleming969/b1ff012568481de42c8b34f697fb1d97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fs = require('fs'); | |
const Cheerio = require('cheerio'); | |
/* | |
* This script simply extracts the head and body content from react-scritps | |
* production build and puts them in separate files for teamraiser | |
* pagewrapper | |
*/ | |
const content = Fs.readFileSync('./build/index.html', 'utf-8'); | |
const $ = Cheerio.load(content); | |
const head = $('head'); | |
Fs.writeFileSync('./build/head.html', head.html(), 'utf-8'); | |
const body = $('body'); | |
Fs.writeFileSync('./build/body.html', body.html(), 'utf-8'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment