{"id":20466905,"url":"https://github.com/fwh1990/webpack-genius","last_synced_at":"2026-03-16T19:03:57.611Z","repository":{"id":51945799,"uuid":"221389554","full_name":"fwh1990/webpack-genius","owner":"fwh1990","description":"TS定制版智能webpack框架","archived":false,"fork":false,"pushed_at":"2021-05-11T17:25:27.000Z","size":4455,"stargazers_count":10,"open_issues_count":6,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-30T01:03:58.565Z","etag":null,"topics":["genius","webpack","webpack-chain","webpack-chains","webpack-cli"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fwh1990.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-13T06:35:14.000Z","updated_at":"2021-05-24T07:19:36.000Z","dependencies_parsed_at":"2022-08-23T12:11:14.427Z","dependency_job_id":null,"html_url":"https://github.com/fwh1990/webpack-genius","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwh1990%2Fwebpack-genius","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwh1990%2Fwebpack-genius/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwh1990%2Fwebpack-genius/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwh1990%2Fwebpack-genius/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fwh1990","download_url":"https://codeload.github.com/fwh1990/webpack-genius/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625499,"owners_count":21135513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["genius","webpack","webpack-chain","webpack-chains","webpack-cli"],"created_at":"2024-11-15T13:26:21.758Z","updated_at":"2025-10-25T22:47:03.661Z","avatar_url":"https://github.com/fwh1990.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 安装\n\n```bash\nyarn add webpack-genius --dev\n```\n\n# 特性\n* 支持所有常用文件后缀\n* 超快的开发热更新\n* 智能配置，外加TS提示\n\n# 案例\n[React Hooks](https://github.com/redux-model/demo-react-hooks)\n\n# 使用方法\n创建文件 `webpack.config.ts`。注意不是 `.js` 后缀\n```typescript\nimport webpackGenius from 'webpack-genius';\n\nexport default webpackGenius(3000);\n```\n\n然后把下面的指令加入到文件 `package.json`\n```json\n{\n    \"scripts\": {\n        \"start\": \"webpack-genius start\",\n        \"build\": \"webpack-genius build --env production\"\n    }\n}\n```\n\n### 入口文件\n框架会优先使用 `package.json`中的 `main` 字段作为入口文件，如果没有这个字段或者文件不存在，框架会接着自动查找文件 `index`, `Index`, `src/index`, `src/Index`，只要他们携带 `.js`, `.ts`, `.jsx`, `.tsx` 中的任意一个后缀就算找到。\n\n当然了，您也可以手动指定\n```typescript\nimport webpackGenius from 'webpack-genius';\n\nexport default webpackGenius(3000, (genius) =\u003e {\n    genius.entry('./src/entries/index.tsx');\n});\n```\n\n\n### 域名\n默认使用IP `0.0.0.0`，这样本机和局域网都能访问到您的项目。\n\n您也可以使用域名\n```typescript\nimport webpackGenius from 'webpack-genius';\n\nexport default webpackGenius(3000, (genius) =\u003e {\n    genius\n        .entry('...')\n        .devServer((server) =\u003e {\n            server.host = '自定义域名或者IP';\n        });\n});\n```\n\n### 指定 `index.html`\n框架会自动找这些文件 `index`, `public/index`, `src/index`, `src/public/index`, `assets/index`, `src/assets/index`， 只要它们携带 `.html` `.htm` 中的任意一种格式就算找到。\n\n当然了，您也可以手动指定\n```typescript\nimport webpackGenius from 'webpack-genius';\n\nexport default webpackGenius(3000, (genius) =\u003e {\n    genius\n        .entry('...')\n        .pluginHtml((plugin) =\u003e {\n            plugin.setTemplate('./src/entries/index.html');\n        });\n});\n```\n\n### Css Modules\n强烈推荐各位使用 `css-modules` 特性，有了它，我们不再需要关心样式是否会被污染或者覆盖了。\n\n当然了，您也可以关掉它\n```typescript\nimport webpackGenius from 'webpack-genius';\n\nexport default webpackGenius(3000, (genius) =\u003e {\n    genius\n        .disableCssModules();\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwh1990%2Fwebpack-genius","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffwh1990%2Fwebpack-genius","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwh1990%2Fwebpack-genius/lists"}