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

hym-react-cli

v2.0.9

Published

React + Ts + Stylus + Cesium + dll脚手架

Downloads

3

Readme

hym-react-cli

🚀 基于create-react-app的React + Ts + Stylus + Cesium + dll集成脚手架, 可根据个人需要一键配置可选模板

一键配置可选模板,自动安装依赖,生成文件夹目录

使用

npm i -g hym-react-cli

npx create-hym-react <projectName> --template <template>
<projectName> 项目名称
<template> 可选模板, <template>内填入使用的模板, 以逗号隔开, 如果不填默认为不配置模板。可选值: ts,cesium,stylus,dll,all。all为配置所有模板

事例: create-hym-react demo --template ts,stylus

杂项

如果在windos上遇到C:\Users\xxx\AppData\Roaming\npm\create-hym-react.ps1,禁止在本系统上运行脚本。

请在CMD执行 set-ExecutionPolicy RemoteSigned

扩展webpack

/*
    node

    react-app-rewired 对webpack配置进行扩展。
                      用法: 在根目录新建 config-overrides.js文件, 然后配置npm命令,详情见package.json。
*/
$ npm i react-app-rewired customize-cra -D

/*
    config-overrides.js
*/
module.exports = function override(...args)
// args[i] = function (config, env) { return config }
// config: react输出的webpack配置对象
// env: 模式

/*
    如果不希望配置文件在根目录并且自定义文件名称,可以在package.json增加如下配置:

    package.json
*/
"config-overrides-path": path // path为你定义的路径,如: './目录/文件名'

配置dll

在使用的库过多或过大时我们需要配置dll对一些库单独打包以优化构建速度,所以在该模板中配置了dll。

$ npm i webpack-cli add-asset-html-webpack-plugin -D
/*
    dll的基本配置可以在以下文件中找到:
        ./scripts/dll.js    development配置
        ./scripts/dll_bundle.js     production配置
        ./scripts/overrides.js -> dllConfig     引入配置
*/
/*
    用法:
        1. 在dll.js和dll_bundle.js的vendor添加需要单独打包的库
        2. 执行一次npm run dll 和 npm run dll:build
*/

配置Cesium

./scripts/overrides.js -> cesiumConfig 已经包含了Cesium配置,下面只说明Cesium的静态资源配置:

$ npm i cesium -S
$ npm i copy-webpack-plugin -D
import { Ion } from 'cesium'

// 为当前项目配置Cesium静态资源的根路径
window.CESIUM_BASE_URL = process!.env!.NODE_ENV === 'development' ? devPath : prodPath
// 设置令牌
Ion.defaultAccessToken = xxx