Skip to content

Commit

Permalink
feat: support webpack5 with [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
leftstick committed Mar 11, 2021
1 parent 53088a7 commit c985338
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 28 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
![][dt-url]
![][license-url]

Yeoman generator for umi project
Yeoman generator for umi project.

> **This generator doesn't support SSR**
> Read documentation here: [https://dfocusgroup.github.io/generator-umi/](https://dfocusgroup.github.io/generator-umi/)
Expand Down
1 change: 1 addition & 0 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ module.exports = class extends Generator {
this.fs.copy(this.templatePath('typings.d.ts'), this.destinationPath('typings.d.ts'))

this.fs.copyTpl(this.templatePath('config'), this.destinationPath('config'), this.answer)
this.fs.copyTpl(this.templatePath('husky'), this.destinationPath('.husky'), this.answer)
this.fs.copyTpl(this.templatePath('mock'), this.destinationPath('mock'), this.answer)
this.fs.copyTpl(this.templatePath('public'), this.destinationPath('public'), this.answer)
this.fs.copyTpl(this.templatePath('server'), this.destinationPath('server'), this.answer)
Expand Down
3 changes: 2 additions & 1 deletion generators/app/templates/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ export default defineConfig({
locale: {
antd: true,
title: true
}
},
webpack5: {}
})
1 change: 1 addition & 0 deletions generators/app/templates/husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions generators/app/templates/husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
4 changes: 4 additions & 0 deletions generators/app/templates/husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
45 changes: 20 additions & 25 deletions generators/app/templates/package.json.vm
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
"description": "Scaffold for umi based project",
"scripts": {
"start": "umi dev",
"build": "UMI_ENV=prod umi build"
"build": "UMI_ENV=prod umi build",
"prepare": "husky install"
},
"license": "MIT",
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
Expand All @@ -22,28 +17,28 @@
"*.{j,t}s?(x)": "eslint --max-warnings=0 --ignore-pattern=public/**/*"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@types/classnames": "^2.2.10",
"@types/faker": "^5.1.2",
"@types/jest": "^26.0.14",
"@commitlint/cli": "^12.0.1",
"@commitlint/config-conventional": "^12.0.1",
"@types/classnames": "^2.2.11",
"@types/faker": "^5.1.7",
"@types/jest": "^26.0.20",
"@types/js-cookie": "^2.2.6",
"@umijs/plugin-access": "^2.3.1",
"@umijs/plugin-antd": "^0.8.0",
"@umijs/plugin-initial-state": "^2.2.1",
"@umijs/plugin-locale": "^0.10.3",
"@umijs/plugin-model": "^2.5.4",
"@umijs/plugin-request": "^2.5.0",
"@umijs/test": "^3.2.23",
"faker": "^5.1.0",
"husky": "^4.3.0",
"lint-staged": "^10.4.0",
"@umijs/plugin-access": "^2.3.3",
"@umijs/plugin-antd": "^0.9.1",
"@umijs/plugin-initial-state": "^2.3.0",
"@umijs/plugin-locale": "^0.10.9",
"@umijs/plugin-model": "^2.5.6",
"@umijs/plugin-request": "^2.5.2",
"@umijs/test": "^3.4.0",
"faker": "^5.4.0",
"husky": "^5.1.3",
"lint-staged": "^10.5.4",
"react-coding-style": "^1.3.1",
"umi": "^3.2.23",
"umi-plugin-dynamic-antd-theme": "^3.0.1"
"umi": "^3.4.0",
"umi-plugin-dynamic-antd-theme": "^3.1.0"
},
"dependencies": {
"ahooks": "^2.6.1",
"ahooks": "^2.9.6",
"classnames": "^2.2.6",
"js-cookie": "^2.2.1"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-umi",
"version": "4.6.0",
"version": "4.6.1",
"description": "umi project generator",
"scripts": {
"docs:dev": "vuepress dev docs",
Expand Down

0 comments on commit c985338

Please sign in to comment.