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

@jkyu/uc-react-scripts

v2.1.6

Published

React CRA 快速升级Webpack5

Downloads

5

Readme

Webpack5 React Scripts

👨‍🏫 描述

  • uc-react-scripts 主要解决基于create-react-app的项目,快速升级Webpack 5使用

🙋‍♂️ 快速开始

  • 初始化 CMA 项目: npx @jkyu/create-monet-app init

📦 安装

npm i -g @jkyu/create-monet-app or yarn global add @jkyu/create-monet-app

👨‍🔧 功能迭代

更新文档

👨‍💻 指令

  • uc-react-scripts info 查看当前运行环境
  • uc-react-scripts dev 调试
    • uc-react-scripts dev --env test 运行环境
    • uc-react-scripts dev --verbose 关闭webpack错误或警告信息 默认为 false
  • uc-react-scripts build 构建
    • uc-react-scripts build --env test 指定 部署环境
  • uc-react-scripts help

🧑‍💻 如何使用uc-react-scripts项目

1) 安装 react-app-rewired

$ npm install @jkyu/uc-react-scripts --save-dev

2) 在根目录中创建一个 mjd-config-overrides.js 文件

/* mjd-config-overrides.js */
module.exports = {
  webpack: (config, env) => config,
  devServer: (configFunction) =>{
    return function(proxy, allowedHost) {
      // configFunction --> dev config
      return configFunction(proxy, allowedHost);
    };
  },
  paths:(paths, env) => paths,
  custom: {}, // 根据webpack结构,对配置进行覆盖
  override: (config) => config // 根据已经生成的config,进行修改
};
+-- your-project
|   +-- mjd-config-overrides.js
|   +-- node_modules
|   +-- package.json
|   +-- public
|   +-- README.md
|   +-- src

3) 替换 package.json 中 scripts 执行部分

  /* package.json */

  "scripts": {
-   "start": "react-scripts start",
+   "start": "uc-react-scripts dev",
-   "build": "react-scripts build",
+   "build": "uc-react-scripts build",
}

4) 启动 Dev Server

$ npm start

5) 构建你的应用程序

$ npm run build