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

ero-cli

v1.0.5-1

Published

CLI工具

Downloads

23

Readme

support

  • 支持 HRM
  • 支持 code spliting
  • 支持生成 hash 的配置
  • 支持代码运行错误的界面提示

使用方式

CLI 命令执行方式

  • ero init : 按照相应的提示步骤进行模板项目的创建 【文档系统定制化的命令,生成ant-design模板,其他项目无需执行此项】

  • ero --help : 查看 CLI 命令帮助信息

  • ero run server : 启动服务

  • ero run build : 代码打包

.webpackrc.js 配置示例

  • 备注说明:基本配置跟 webpack4.0 官网配置一样

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

const cwd = process.cwd();

module.exports = {
  entry: {                                      // 入口文件
    app: [
      path.resolve(cwd, 'entry.js')
    ],
    vendor: [
      'react',
      'react-dom',
      'react-router',
    ],
    pollyfill: [
      path.resolve(cwd, 'pollyfill.js')
    ],
  },
  output: {                                     // 输出文件
    publicPath: '/',
    filename: 'js/[name].js',
  },
  externals: {                                  // 第三方库引用

  },
  plugins: [

  ],
  port: 9898,                                   // 自定义服务端口 默认端口: 9898
  hash: true,                                   // css 是否需要 hash
  extractCss: true,                             // 是否单独剥离 css  default: true
  imgPublicPath: '/'                            // 线上图片地址引用路径,目前只能对背景引用地址进行处理
  target: 'default',                            // 生成代码的模式 可选项:commonjs -- 针对npm发包代码
  resolve: {},                                  // 简化代码 import 路径
  externalsConfig: {},                          // 可自行进行webpack配置,相同的webpack参数配置会覆盖已提供的配置参数
  ts: false,                                    // 是否需要支持ts功能
  eslint: false,                                // 是否需要支持eslint
}

ISSUE

  • 如果出现 node-sass 版本问题

node-sass

解决方法: 使用 npm rebuild node-sass

DockerFile 示例

  • 如果项目使用docker进行项目打包,可以参考如下配置
FROM node:10.4.0-stretch as builder
EXPOSE 80
RUN npm config set registry http://registry.npm.taobao.org \
    && npm install  -g ero-cli 

WORKDIR /code

ADD  package.json /code

RUN npm install

ADD . /code

RUN  npm run inner:build \
  && npm run home:build

FROM nginx:alpine

COPY --from=builder /code/tuijian /usr/share/nginx/html/tuijian
COPY --from=builder /code/static /usr/share/nginx/html/tuijian/static