Skip to content

Commit

Permalink
dev: 修改dev依赖从 unique-commit-id 至 git-commit-id
Browse files Browse the repository at this point in the history
unique-commit-id 错误的将 devDependencies 写入 dependencies,
导致node_modules中引入了过多无必要的npm packages
  • Loading branch information
Rhilip committed Aug 20, 2021
1 parent b03c5fe commit 08db660
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 624 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -91,7 +91,7 @@
"ts-node": "^8.5.2",
"typescript": "^3.0.0",
"uglifyjs-webpack-plugin": "^2.0.1",
"unique-commit-id": "^1.0.0",
"git-commit-id": "^2.0.1",
"vue-cli-plugin-vuetify": "^0.4.6",
"vue-template-compiler": "^2.5.17",
"vuetify-loader": "^1.0.5",
Expand Down
4 changes: 2 additions & 2 deletions webpack/prod-background.js
Expand Up @@ -2,7 +2,7 @@ const merge = require("webpack-merge");
const common = require("./common.js");
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const ucid = require("unique-commit-id");
const gitCommitId = require('git-commit-id');

// 用于替换 @ 符号的路径
function resolve(dir) {
Expand Down Expand Up @@ -32,7 +32,7 @@ module.exports = merge(common, {
to: path.join(resolve('dist'), "manifest.json"),
transform (content, path) {
var manifest = JSON.parse(content.toString());
manifest.version_name = `${manifest.version}.${ucid.latest()}`; // ex: '01ef00a'
manifest.version_name = `${manifest.version}.${gitCommitId().slice(0, 7)}`; // ex: '01ef00a'
return JSON.stringify(manifest);
}
}
Expand Down

0 comments on commit 08db660

Please sign in to comment.