Code Monkey home page Code Monkey logo

multi-page-app-with-react's Introduction

Multi Page App with React

A lightweight, flexible Webpack setup with React for multi page application development.

You should consider this setup when you want to use React for some sections of your page(s), but you don't want to make it Single Page Application (SPA) with only a <div id="app"> in the body tag.

Here's a code sample to illustrate this concept for an example static page with several React components: picture alt

A basic write up of this setup can be found on this Medium post.

Notice: the latest code base includes the following updates:

  • webpack bundles with hashed filenames
  • code linter (with Airbnb style guide)
  • enabled CSS modules (added example css styles)
  • minimize webpack bundles with TerserPlugin (i.e. js code minification)
  • file loader to resolve imports on fonts and images (added example product image)

Quick Start

install dependencies

$ npm install

Development & Build

dev

$ npm start

start script runs server in development mode with hot module replacement and open the browser after server had been started.

build

$ npm run build

build script runs in production mode to improve load time (i.e. minified bundles, lighter weight source maps etc)

linting

$ npm run lint

lint script runs linter to check for lint errors in src directory

multi-page-app-with-react's People

Contributors

przemek-nowicki avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.