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

react-builder-rc

v2.0.5

Published

基于webpack5 + babel7 的一个react构建器

Downloads

29

Readme

介绍

基于webpack5、babel7开发的一款 react项目构建器

特性

  • 基于webpack5、babel7开发

  • 集成了 TypeScript构建、webpack-dev-server支持、热更新、最新的babel配置(支持到es2020)

  • 让你不再关注 bable 和 webpack等乱七八糟头疼的配置

  • 不需要改动之前已有的代码,轻松接入

  • 目前支持 devbuild 两个常用构建指令

  • 支持微前端构建,支持微前端单文件打包构建,支持统一入口打包构建

  • 提高开发效率、提高团队前端工程化能力

  • 支持通过config-overrieds 文件去添加 webpack 配置

安装

npm install --save-dev react-builder-rc

使用

package.json 配置

builder-config

这个配置告知构建器,你要使用什么方式去构建项目

"builder-config": {},

| Parameter | Description | Type | Optional Value | Default | | -------------- | ---------------------------- | ------- | -------------- | ------- | | devPublicPath | 开发环境publicPath | string | -- | '/' | | prodPublicPath | 生产环境publicPath | string | -- | '/' | | typescript | 是否开启ts构建 | boolean | -- | false |

npm scripts

"dev": "react-builder-rc dev",
"build": "react-builder-rc build",

| Description | Type | Optional Value | Default | | --------------------------------------- | ------ | -------------- | ----------- | | 开发 指令 | string | dev | dev | | 构建 指令 | string | build | build | | 是否开启 profile 分析 | string | --profile | none |

Template 配置

config-overrides.js

现在项目中必须在根目录 添加 config-overrieds.js,它可以让你添加webpack配置,哪怕你不需要也要返回config对象

在你不清楚的情况下 你最好只添加externals和devServer的配置,其他配置的已经内置好

alais别名: 已经动态读取了src下的目录,eg: src: src; components: components。文件夹名字是什么 别名就是什么

module.exports = function(config) {
  config.externals = {};
  config.devServer = {};
  return config;
};

SPA入口项目

单入口页面: 入口文件index.ts / index.js 必须放在src文件夹根目录下

静态模板html: 项目根目录下创建 example文件夹,并在example下创建index.html 作为静态模板html