Skip to content

Software of Development with React, Babel, NodeJS, Sass, etc

Notifications You must be signed in to change notification settings

JohnMCAdams/react-boilerplate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REACT Boilerplate

Description

This repository is a Software of Application with React,NodeJS,Babel,Webpack,SASS, etc.

Installation

Using Node,Babel,Webpack Cli, Webpack Dev Server preferably.

DataBase

Using SQLite3,MongoDB,MySQL,etc.

Usage

$ git clone https://github.com/DanielArturoAlejoAlvarez/react-boilerplate[NAME APP]

$ npm install 

$ npm run dev (DEVELOPMENT) 

$ npm run build (PRODUCTION)

Follow the following steps and you're good to go! Important:

alt text

Coding

Config

...
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

const devMode = process.env.NODE_ENV !== 'production'

module.exports = {
  entry: "./src/index.js",
  output: {
    path: path.join(__dirname, "dist"),
    filename: "bundle.js",
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: ["babel-loader"],
      },
      {
        test: /\.s[ca]ss$/i,
        use: [
          {
            loader: MiniCssExtractPlugin.loader,
            options: {
              hmr: process.env.NODE_ENV === 'development',
            },
          },
          {
            loader: "css-loader"
          },
          {
            loader: "sass-loader"
          },
        ],
      },
    ],
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: "./src/index.html",
      filename: "index.html",
    }),
    new MiniCssExtractPlugin({
      filename: devMode ? '[name].css' : '[name].[hash].css',
      chunkFilename: devMode ? '[id].css' : '[id].[hash].css',
    }),
  ],
  devServer: {
    contentBase: path.join(__dirname,'dist'),
    compress:true,
    port: 9000
  }
};
...

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/DanielArturoAlejoAlvarez/react-boilerplate. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.


About

Software of Development with React, Babel, NodeJS, Sass, etc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 67.1%
  • CSS 24.8%
  • HTML 8.1%