Giter VIP home page Giter VIP logo

ai-zubair / react-typescript-webpack-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 69 KB

Minimalistic Webpack-5 build environment for React-v17 and TypeScript-v4.

License: MIT License

JavaScript 36.14% HTML 4.49% TypeScript 59.37%
react17 webpack5 typescript4 webpack-boilerplate reactjs typescript react-boilerplate react-typescript-boilerplate react-typescript-starter react-webpack-boilerplate

react-typescript-webpack-boilerplate's Introduction

About

Minimalistic Webpack-5 build environment for React-v17 and TypeScript-v4.

Features

  1. AsyncRoute HOC for code splitting of route-level React components.

  2. Separate webpack configurations for development and production environments.

  3. Presets system to add/over-ride webpack configurations on the fly.

  4. webpack-dev-server for local hosting in development.

How to?

  • Adding preset configurations to webpack:

    1. Write the webpack configuration file for the preset.
    2. Name the configuration file as webpack.<preset-name>.js.
    3. Add the webpack configuration to build-utils/presets/ directory.
  • Invoking webpack preset configurations:

    Preset configurations are invoked by specifying a presets key on webpack's environment object, in the build command.

        build-command -- --env presets=<preset-name>
    

    Mutiple presets can be invoked as a comma separated list of preset names. Assuming we've added 3 preset configuration files as:

    • webpack.<preset-name-1>.js
    • webpack.<preset-name-2>.js
    • webpack.<preset-name-3>.js

    The configurations can be simultaneously invoked as:

      build-command -- --env presets=<preset-name-1>,<preset-name-2>,<preset-name-3>
    
  • Environment specific configurations:

    • Webpack configurations specific to development and production environments can be respectively added to webpack.development.js and webpack.production.js in the build-utils/mode-configs/ directory.

    • Environment specific configurations can be invoked with a mode key on webpack's environment object, in the build command.

          build-command -- --env mode=<development | production>
      

Get Started

Build and run the project locally with npm run build:dev

react-typescript-webpack-boilerplate's People

Contributors

ai-zubair avatar

Watchers

 avatar  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.