Skip to content

Commit

Permalink
Merge pull request #120 from xtremespb/core_240521_2
Browse files Browse the repository at this point in the history
Fix: build process updated
  • Loading branch information
xtremespb committed May 24, 2021
2 parents e99ce66 + 01e671d commit 45b9b6d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 280 deletions.
11 changes: 8 additions & 3 deletions dev/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const {
const minify = require("@node-minify/core");
const htmlMinifier = require("@node-minify/html-minifier");
const packageJson = require("../package.json");
const packageLock = require("../package-lock.json");

const cleanUpWeb = argv => {
[argv.update ? "build/public/update_" : "build/public/zoia_", "build/scripts"].map(d => {
Expand Down Expand Up @@ -175,15 +174,21 @@ const installRequiredPackages = async (moduleDirs, argv) => {
continue;
}
const cmd = Object.keys(npmData).map(m => {
if (!packageLock.dependencies[m] || packageLock.dependencies[m].version !== npmData[m].replace(/\^/gm, "")) {
if (!packageJsonCore.dependencies[m] || packageJsonCore.dependencies[m] !== npmData[m] || !packageJsonCore.devDependencies[m] || packageJsonCore.devDependencies[m] !== npmData[m]) {
try {
require(m);
return null;
} catch (e) {
console.log(e.message);
}
return `${m}@${npmData[m]}`;
}
}).filter(i => i).join(" ");
if (cmd && cmd.length) {
try {
console.log(`Installing NPM packages for module "${dir}"...`);
// eslint-disable-next-line no-await-in-loop
execSync(`npm i ${cmd} --loglevel=error --save`);
execSync(`npm i ${cmd} --loglevel=error`);
} catch (e) {
console.error(e);
process.exit(1);
Expand Down
Loading

0 comments on commit 45b9b6d

Please sign in to comment.