npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@wz-libs/rc-service

v1.0.7

Published

react + webpack5

Downloads

6

Readme

React Start or build

Environment

  • node v12.13.0+
  • webpack v5.38+
  • webpack-cli v4.9+
  • webpack-dev-server v4.7+

1、Git clones use projects

git clone https://gitee.com/my_domain/rc-react-project.git

cd rc-react-project

yarn 

yarn start

2、Replace to use

Install

npm install @wz-libs/rc-service -D

or

yarn add @wz-libs/rc-service -D

command

command | explain | remark --- | --- | --- start | The development environment runs commands | yarn start / npm run start build | The production environment runs commands | yarn build / npm run build analyse --development | Development environment performance analysis | yarn analyse --development / npm run analyse --development analyse --production | Production environment performance analysis | yarn analyse --production / npm run analyse --production

command extend

## Note: if APP_ENV is not set and exists, the. Env file will be loaded by default

Read environment variables from files .env.[APP_ENV]
Example: npm run start -m dev
npm run start -m [APP_ENV] Or npm run start --mode [APP_ENV]

npm run build -m [APP_ENV] Or npm run build --mode [APP_ENV]

directory


├── public                      // Static resource file
│   ├── index.html              // index.html
├── src                         // Important folder
│   ├── index.js                // React run and webpack compile entry file The must
│   ├── App.js                  // Render route page
│   ├── pages                   // React pages
│   ├── assets                  // assets
├── .env/.env.[APP_ENV]        // Environment Variable Configuration
├── rcw.config.js               // custom webpack config
├── .babelrc                    // babel config
├── package.json                // package.json

rcw.config.js

### The global environment variable NODE_ENV is the built-in variable

const { merge } = require('webpack-merge')
module.exports = {
    webpackConfig: (config,isDev, APP_ENV) => {
        return merge(config, {
            // your webpack config
        });
    }
}

package.json

"scripts": {
    "start": "rc-service start",  // The development of start
    "build": "rc-service build", // The deployment of building
    "analyse:dev": "rc-service analyse --development", // Development environment performance analysis
    "analyse:prod": "rc-service analyse --production" // Production environment performance analysis
  },
"dependencies": {
  "react": "^17.0.2",
  "react-dom": "^17.0.2",
  "react-router-dom": "^6.2.1"
},
"devDependencies": {
  "@wz-libs/rc-service": "^1.0.0"
}