Browse Source

chore: 修改打包

es6
iapyang 5 years ago
parent
commit
51aebafddb
  1. 12
      lib/prepublish/prepublish.js

12
lib/prepublish/prepublish.js

@ -1,10 +1,6 @@
const { resolve } = require("path"); const { resolve } = require("path");
const { writeFileSync } = require("fs"); const { writeFileSync } = require("fs");
// if (!process.env.VERDACCIO_AUTH) {
// return;
// }
function pad2(n) {// always returns a string function pad2(n) {// always returns a string
return (n < 10 ? "0" : "") + n; return (n < 10 ? "0" : "") + n;
} }
@ -20,8 +16,10 @@ const version = d.getFullYear() +
const packageJSON = require("../../package.json"); const packageJSON = require("../../package.json");
packageJSON.version = `2.0.${version}`; const versionChars = packageJSON.version.split(".");
writeFileSync(resolve(__dirname, "../../package.json"), JSON.stringify(packageJSON, null, 2)); versionChars[versionChars.length - 1] = version;
// writeFileSync(resolve(__dirname, "../../.npmrc"), `//192.168.5.154:4873/:_authToken="${process.env.VERDACCIO_AUTH}"`); packageJSON.version = versionChars.join(".");
writeFileSync(resolve(__dirname, "../../package.json"), JSON.stringify(packageJSON, null, 2));

Loading…
Cancel
Save