-
Notifications
You must be signed in to change notification settings - Fork 3
/
generator.js
48 lines (47 loc) · 1.29 KB
/
generator.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
module.exports = (api, options, rootOptions) => {
// 修改 `package.json` 里的字段
api.extendPackage({
scripts: {
analyz: 'vue-cli-service build --mode analyz'
},
dependencies: {
'babel-polyfill': '^6.26.0',
'meisha-fe-watch': '^1.0.2',
'vue-i18n': '^8.9.0',
'steam-game-ui': '^0.1.4'
},
devDependencies: {
'@vue/eslint-config-standard': '^4.0.0',
'eslint-config-standard': '^12.0.0',
'eslint-plugin-import': '^2.16.0',
'eslint-plugin-node': '^8.0.1',
'eslint-plugin-promise': '^4.0.1',
'eslint-plugin-standard': '^4.0.0',
'compression-webpack-plugin': '^2.0.0',
'webpack-bundle-analyzer': '^3.3.2',
'image-webpack-loader': '^5.0.0',
husky: '^1.3.1',
'lint-staged': '^8.1.5',
prettier: '^1.16.4'
},
husky: {
hooks: {
'pre-commit': 'lint-staged'
}
},
'lint-staged': {
'*.{js,vue}': [
'prettier --write"',
'eslint --ext .js,.vue src',
'git add'
]
}
});
// 复制并用 ejs 渲染 `./template` 内所有的文件
api.render('./template', {
projectName: rootOptions.projectName,
gameName: options.gameName,
gameServerId: options.gameServerId,
isGameHasEnVersion: options.isGameHasEnVersion
});
};