New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-to-ssr-cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-to-ssr-cli

A command-line interface for server-side rendering (SSR) React applications effortlessly.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

React-SSR-CLI

react-ssr-cli is a command-line interface for converting React applications into server-side rendered (SSR) applications effortlessly.

Features

  • Convert React applications to server-side rendered (SSR) applications.
  • Simple command-line interface for quick usage.
  • Flexible configuration options to customize SSR settings.

Installation

npm install -g react-to-ssr-cli

Usage

To use react-ssr-cli, navigate to the root folder of your built React application. Make sure you've built your React application using your preferred method (e.g., npm run build).

Then, run the following command:

ssr

This command will convert the React application in the current directory to a server-side rendered (SSR) application.

If you prefer to use npm scripts, you can add a script to your package.json file like this:

"scripts": {
  ...
  "ssr": "npm run build && react-ssr ./ssr-output"
}

Configuration

To configure react-ssr-cli, create a file named ssr-config.json in the root folder of your project. Use the following format to specify configuration options:

{
  "port": 3000,
  "appPath": "./src/App.js",
  "routes": ["^/$"]
}

If ssr-config.json is not present, react-ssr-cli will use default configuration values. The example above represents the default configuration values.

FAQs

Package last updated on 24 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts