Skip to content

Creates a single HTML page from create-react-app build

Notifications You must be signed in to change notification settings

mritzco/singleHTML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-app-singleHTML

Packs a build version of create-react-app into a single self-contained HTML file with no external references. The output can be used in some restricted sytems. i.e. Sharepoint, NetSuite.

It replaces references to Javascript and CSS with their codes and removes manifest, favicon and maps.

This library uses streams and keeps minimal info in memory.

Installation

npm install --save-dev react-app-singlehtml

Use from command line

node cli.js [/your/build/index.html] [targetPath]

Use for building

Add a script in your project package.json

"scripts": {
  "singlepage": "react-app-singlehtml build/index.html build/singlepage.html"
}

Auto build

If you want to use as part of your create-react-app or other app worflow: Modify the package.json

"scripts": {
  "postbuild": "react-app-singlehtml build/index.html build/singlepage.html"
}

Update to use your actual paths

About

Creates a single HTML page from create-react-app build

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published