{"id":26565433,"url":"https://github.com/freemenl/empty-desgin","last_synced_at":"2026-03-05T09:02:59.367Z","repository":{"id":39487684,"uuid":"160947143","full_name":"FreemenL/empty-desgin","owner":"FreemenL","description":"基于typescript react webpack的脚手架 ","archived":false,"fork":false,"pushed_at":"2023-03-22T23:48:19.000Z","size":47990,"stargazers_count":32,"open_issues_count":32,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-19T01:26:58.821Z","etag":null,"topics":["antd","connected-react-router","emptyd","lodash","moment","nodemon","react","react-redux","react-router-dom","reactjs","redux","typescript"],"latest_commit_sha":null,"homepage":"http://152.136.132.237/desgin/#/home/home","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FreemenL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-12-08T14:29:17.000Z","updated_at":"2025-06-05T05:03:54.000Z","dependencies_parsed_at":"2023-01-26T01:45:44.475Z","dependency_job_id":"2ce07ec6-1335-4687-a528-d3adc1c9d619","html_url":"https://github.com/FreemenL/empty-desgin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FreemenL/empty-desgin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreemenL%2Fempty-desgin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreemenL%2Fempty-desgin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreemenL%2Fempty-desgin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreemenL%2Fempty-desgin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FreemenL","download_url":"https://codeload.github.com/FreemenL/empty-desgin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreemenL%2Fempty-desgin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30117482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antd","connected-react-router","emptyd","lodash","moment","nodemon","react","react-redux","react-router-dom","reactjs","redux","typescript"],"created_at":"2025-03-22T17:30:26.754Z","updated_at":"2026-03-05T09:02:59.288Z","avatar_url":"https://github.com/FreemenL.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# empty-desgin\r\n\r\n[![GitHub issues](https://img.shields.io/github/issues/FreemenL/emptyd-admin-webpack)](https://github.com/FreemenL/emptyd-admin-webpack/issues) [![GitHub forks](https://img.shields.io/github/forks/FreemenL/emptyd-admin-webpack)](https://github.com/FreemenL/emptyd-admin-webpack/network) [![GitHub stars](https://img.shields.io/github/stars/FreemenL/emptyd-admin-webpack)](https://github.com/FreemenL/emptyd-admin-webpack/stargazers)[![GitHub license](https://img.shields.io/github/license/FreemenL/emptyd-admin-webpack)](https://github.com/FreemenL/emptyd-admin-webpack)\r\n\r\n基于typescript react webpack的前端生态 \r\n![WechatIMG121](https://user-images.githubusercontent.com/23741346/227056477-2048bdd9-4834-46c2-a783-1b805fe33a76.png)\r\n![WechatIMG122](https://user-images.githubusercontent.com/23741346/227056579-cbbf6261-70b9-432a-a151-665ab55c2ac9.jpeg)\r\n![WechatIMG123](https://user-images.githubusercontent.com/23741346/227056591-c93e0ab8-f701-4184-b247-04f243fbe363.jpeg)\r\n![WechatIMG124](https://user-images.githubusercontent.com/23741346/227056612-9b3cf33b-091a-4fe1-919c-dbc4f31607a5.jpeg)\r\n\r\n![WechatIMG125](https://user-images.githubusercontent.com/23741346/227056617-81681bab-ecda-4807-a5cb-74f9798aea84.jpeg)\r\n![WechatIMG126](https://user-images.githubusercontent.com/23741346/227056634-40973707-f173-4cc5-963a-44977d2e2ca7.jpeg)\r\n![WechatIMG127](https://user-images.githubusercontent.com/23741346/227056649-53aebdb8-352a-4f52-9ae5-415be52c2ad6.jpeg)\r\n![WechatIMG128](https://user-images.githubusercontent.com/23741346/227056664-39210f90-bb3f-4f68-b706-418fc0c2bb34.jpeg)\r\n\r\n### empty-desgin 生态:\r\n\r\n* 工程脚手架: [create-empty-app](https://github.com/FreemenL/create-empty-app.git)    empty-desgin 工程脚手架\r\n* babel插件: [babel-plugin-empty-import](https://github.com/FreemenL/babel-plugin-empty-import) 解决自身组件及第三方模块全量导入的问\r\n* webpack插件:  [empty-webpack-build-detail-plugin](https://github.com/FreemenL/empty-webpack-build-detail-plugin.git) 对webpack的编译过程进行日志监控\r\n* 静态资源服务:   [empty-server](https://github.com/FreemenL/empty-server.git) 一个简单的、零配置的命令行 http 服务器。它对于生产使用来说足够强大，但它足够简单且易于破解，可用于测试、本地开发和学习。\r\n* empty工具库:   [empty-tool](https://github.com/FreemenL/empty-tool.git) \r\n\r\n### 关于本项目功能\r\n\r\n1.针对不同的loader采用了多进程编译，指定精确处理的目录和排除的目录，并开启缓存 极大的加快了编译速度。\r\n\r\n2.使用webpack.DllReferencePlugin 根据环境自动 提取固定资源，加快编译与打包速度\r\n\r\n3.区分生产环境和开发环境。\r\n\r\n4.启用cssmodule 默认使用postcss + postcss-cssnext，内置处理浏览器前缀。\r\n\r\n5.启用 tree shaking \r\n\r\n6.启用 scope hoisting  \r\n\r\n7.Babel配有transform-runtime让代码更优化\r\n\r\n8.更改文件,防缓存的hash规则\r\n \r\n9.把小图片转成base64码  \r\n\r\n10.快速编译，热更新，自动刷新\r\n\r\n11.resolve.modules 优化模块查找路径 \r\n\r\n12.optimization splitChunks 合并公共代码\r\n\r\n13.单独抽离css文件\r\n\r\n14.压缩css js 文件。\r\n\r\n15.大文件跳过编译 直接拷贝\r\n\r\n16.自定义loader 优化文件引入 \r\n\r\n17.自定义plugin 输出编译产出 \r\n\r\n18.nodemon 监听配置文件改动\r\n\r\n19.系统级的错误提示\r\n\r\n20.端口冲突自动切换 \r\n\r\n21.自动生成编译日志\r\n\r\n22.编译结果可视化 \r\n\r\n23.本地端口运行打包后项目 \r\n\r\n24.脚手架 配置化\r\n## 程序目录\r\n\r\n```\r\n├── build                    # webpack 配置目录\r\n│   ├── loaders              # 自定义loader目录\r\n│   ├── plugins              # 自定义plugin目录\r\n│   ├── template             # html模版目录\r\n├── config                   # 系统配置目录\r\n├── dist                     # 打包资源\r\n├── log                      # 日志目录\r\n├── scripts                  # 运行脚本\r\n├── src                      # 源码目录\r\n├── static                   # 静态资路径(直接拷贝的文件)\r\n├── typings                  # ts类型声明文件\r\n├── .babelrc                 # babel配置(预设和插件)\r\n├── .eslintrc.js             # eslint配置\r\n├── package.json             # 项目描述\r\n├── postcss.config.js        # postcss配置\r\n└── tsconfig.json            # ts配置\r\n```\r\n\r\n## 项目启动\r\n\r\n### 环境配置\r\n* 为了把保证项目正常运行，请自行更新相关环境。\r\n1. 安装[node.js](https://nodejs.org/)\r\n   ``` (注意使用node版本v16.17.0)```\r\n2. 安装[git](https://git-scm.com/)\r\n\r\n### 依赖配置ß\r\n1. 首先clone项目\r\n```bash\r\n$ git clone https://github.com/FreemenL/empty-desgin.git\r\n$ cd empty-desgin\r\n```\r\n2. 下载依赖\r\n* 请确保你的环境配置完成，然后就可以开始以下步骤\r\n  ```bash\r\n  $ npm install -g cnpm --registry=https://registry.npm.taobao.org\r\n  $ cnpm i \r\n  $ npm start                     # Compile and launch\r\n  ```\r\n\r\n  ## 命令说明\r\n\r\n开发过程中，你用得最多的会是`npm start`，但是这里还有很多其它的处理：\r\n\r\n|`npm run \u003cscript\u003e`|Explain|\r\n|------------------|-----------|\r\n|start|初始化启动项目（生成Dll文件并启动服务）|\r\n|build|打包|\r\n|ls|将dist目录在本地8080端口运行|\r\n\r\n### 系统配置说明\r\n\r\n```typescript\r\nmodule.exports = {\r\n  // 模式  dev | run  区别:dev 会开启配置文件监听 run 不会\r\n  pattern: 'run',\r\n  // 系统路径配置 相对命令行启动目录 \r\n  systemPath: {\r\n    // 入口文件\r\n    appIndex: 'src/index',\r\n    // ts配置文件\r\n    appTsConfig: 'config/tsconfig',\r\n    // webpack ts配置\r\n    webpackTsConfig: 'config/tsconfig-for-webpack-config',\r\n    // 动态链接库\r\n    appdllLibrary: '_dllLibrary_',\r\n    // title图标\r\n    appFavicon: 'src/public/favicon',\r\n    // 依赖包路径\r\n    appNodeModules: 'node_modules',\r\n    // 日志目录\r\n    appLog: 'log',\r\n    // 源码目录\r\n    appSrc: 'src',\r\n    // 打包路径\r\n    appBuild: 'dist',\r\n    // 配置文件目录\r\n    appConfig: ['build', 'config'],\r\n    // 自定义loader目录\r\n    appLoader: 'build/loaders',\r\n    // 自定义　依赖包路径下需要awesome-typescript-loader 处理的文件目录\r\n    appTsLoader: ['node_modules/_emptyd@0.0.7@emptyd', 'node_modules/_freetool@0.0.3@freetool'],\r\n    // 静态资源路径 存放较大文件 该目录下存放文件会被 CopyWebpackPlugin 直接复制到打包后dist/static 路径\r\n    appStatic: 'static',\r\n    // node_modules 下不会被cssmodule 处理的文件路径\r\n    appExcludeCssModule: ['antd', 'normalize.css', 'rc-texty', 'nprogress', 'braft-editor', 'rc-queue-anim', 'viewerjs'],\r\n    // 路径别名相对源码目录\r\n    appPathAlias: {\r\n      '@src': '',\r\n      '@components': `components`,\r\n      '@actions': `store/actions`,\r\n      '@constants': `store/constants`,\r\n      '@pages': `pages`,\r\n      '@reducers': `store/reducers`,\r\n      '@router': `router`,\r\n      '@store': `store`,\r\n      '@public': `public`,\r\n      '@utils': `utils`,\r\n      '@service': `service`\r\n    }\r\n  },\r\n  // 系统常量\r\n  systemConstant: {\r\n    // 系统名称\r\n    title: 'emptyd系统',\r\n    // html模板文件 路径相对命令行启动目录\r\n    htmlTemplate: './build/template/index.html'\r\n  },\r\n  // 开发环境配置\r\n  devConfig: {\r\n    // 本地服务端口 支持同时启动多个服务\r\n    localServerPort: 8091,\r\n    // 代理配置\r\n    // proxyTable: {\r\n    //   '/**': {\r\n    //     target: 'http://193.112.220.100',\r\n    //     changeOrigin: true,\r\n    //     secure: true\r\n    //   }\r\n    // }\r\n  },\r\n  // 是否生成编译报告  为true时候可在 127.0.0.1:8888查看编译结果\r\n  bundleAnalyzerReport: false,\r\n  // 动态连接库中排除\r\n  dllLibraryExclude: ['freetool','antd','antd-mobile', 'normalize.css'],\r\n  // 是否开启编译缓存 \r\n  onCompiltionCache: false,\r\n  // 是否开启代码检查 \r\n  onLint: true,\r\n  //上传服务器配置\r\n  remoteServer:{\r\n    uploadFile:'./dist/**',\r\n    sshConfig:{\r\n      remotePath:'/root/nginx_szcg/website/zhifa/dist',\r\n      ssh: { // 正式\r\n        host: \"129.139.254.333\",\r\n        port: 22,\r\n        username: 'root',\r\n        password: 'xxxxxxxxxxxxx'\r\n      }, \r\n      commands: [\r\n        // 删除现有文件\r\n        `rm -rf /root/nginx_szcg/website/zhifa/dist`\r\n      ]\r\n    }\r\n  }\r\n}\r\n\r\n```\r\n\r\n##### 欢迎感兴趣的伙伴提pr 一起维护\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreemenl%2Fempty-desgin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreemenl%2Fempty-desgin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreemenl%2Fempty-desgin/lists"}