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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@cyber-tools/spa-build-tools

v11.0.0

Published

单页应用核心构建组件

Downloads

45

Readme

  1. Install
  2. Introduction
  3. proxy代理数据
  4. mock模拟数
  5. project.config.js
  6. Commands

可以作为开发依赖安装:

npm install @cyber-tools/spa-build-tools --save-dev

也可以全局安装:

npm install @cyber-tools/spa-build-tools -g

cyber-spa用于快速构筑项目(不需要自己配置webpack),只需要覆盖少量配置即进行快速开发,后期依赖npm进行升级,尽可能保证加脚手架的可维护性

  • 配置项通过webpack-merge进行合并
  • 集成了webpack等大部分开发依赖
  • 通过npm进行维护升级
module.exports={
  "/test1":{
    target:"",
    changeOrigin:true
  },
  "/test2":{
    target:"",
    changeOrigin:true
  },
};

返回模拟数据具体的使用请参考mocker-api的使用文档

使用示例:

module.exports={
  "GET /test1":(request,response)=>{
    response.send({data:90909});
  },
  "POST /test2":(request,response)=>{
    response.send({data:"kjn"});
  }
};

默认的babel.config内容入下所示:

module.exports = {
  presets: [
    require.resolve("@babel/preset-env"),
    require.resolve("@babel/preset-react")
  ],
  plugins: [
    //装饰器配置使用旧版的stage0
    [require.resolve("@babel/plugin-proposal-decorators"), { legacy: true }],
    //当装饰器配置为legacy:true时需要松散模式
    [require.resolve("@babel/plugin-proposal-class-properties"), { loose: true }],
    [require.resolve("@babel/plugin-transform-runtime")],
    [require.resolve("babel-plugin-import"), {
      libraryName: "antd",
      libraryDirectory: "es",
      style: true
    }]
  ]
}

在项目文件中新建project.config.js来复写构筑工具的默认配置,配置项参考webpack文档

webpackConfig选项中禁止使用entry和output选项

示例文件:


module.exports={
  devServer:{
    port:9000,
    useLocalIp:true
  },
  webpackConfig:{
    
  }
};

开发指令:

cyber-spa dev

打包指令:

cyber-spa  build