Creates a ready-to-use fast-loading webpage, app
Homepage Repository npm Download
npm install quick-react-redux-app@1.9.0
Creates the scripts necessary to develop and publish a lightweight Preact + Redux web app. This tool focuses primarily on:
This tool focuses on laying only the requisite foundation for react-redux web apps. Depending on your use case, you might want to use something more specialized:
Just run this in the console:
npx quick-react-redux-app
This will install and build a small sample application structure.
The file tree created is as follows:
scripts
|- base.html
|- build.js
|- config.js
|- generate-page.js
|- run.js
src
|- default.js
|- favicon.ico
|- favicon.png
|- main.js
|- main.jsx
|- style.css
.gitignore
package.json
README.md
You should only need to worry about the files in the src
folder.
default.js
Defines the title of the web page (title
), the meta description (description
), and the initial state of the redux store (state
).
favicon.ico
Sample default 16x16 favicon.
favicon.png
Sample larger favicon (128x128) for iPhone, etc..
main.js
Entry point for the page's scripts. By default, the primary redux reducer and store is defined here, as well as the react-redux connector.
main.jsx
Entry point for the web page.
style.css
Web page's style sheet.
To run the web app locally, run node in the created project's root level:
node .
To build for production, run build to create an "index" folder:
npm run build
The created "index" folder can be dropped directly on a web server via FTP.
The files in the scripts
folder handle running the application in development and building for production.
base.html
The HTML template that wraps around the page generated in the main.jsx
file. Add any <meta> headers or any other non-page-body things to this file. Uses lazy text replacement during build to prepare the final page:
%_TITLE_%
is replaced with the title specified in the default.js
file%_DESCRIPTION_%
is replaced with the description specified in the default.js
file%_BODY_%
is replaced with the page generated in main.jsx
%_RELOAD_%
is the url to the reload script during development and an empty string in productionbuild.js
Generates the static webpage, builds the script bundle + source map, and copies over the css. This script is executed when running npm run build
.
config.js
Defines the babel and webpack configuration. Also includes the port to use when running the web app in development.
generate-page.js
Converts the page structured in main.jsx
and defined in default.js
into static html.
run.js
Runs a local express web server for developing the web app. This script is executed when running node .
.