Skip to content

Commit

Permalink
Another fix for the build process to copy package.json better
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPshul committed Feb 9, 2023
1 parent 01d8f30 commit f16faff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/func/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@nxazure/func",
"author": "Alex Pshul",
"description": "Nx plugin for Azure Functions to initialize, create, build, run and publish Azure Functions inside your NX workspace.",
"version": "1.0.2",
"version": "1.0.3",
"main": "src/index.js",
"repository": "https://github.com/AlexPshul/nxazure",
"license": "MIT",
Expand Down
9 changes: 6 additions & 3 deletions packages/func/src/executors/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ const getCopyPackageToAppTransformerFactory = (context: ExecutorContext) => {
const cleanedModuleName = node.moduleSpecifier.getText().replace(/['"]/g, '');
const moduleInOriginalPackageJson = findModule(originalPackageJson.dependencies, cleanedModuleName);
// If the original package.json has the dependency, copy it to the app package.json
if (moduleInOriginalPackageJson && appPackageJson.dependencies[cleanedModuleName] !== moduleInOriginalPackageJson) {
appPackageJson.dependencies[cleanedModuleName] = originalPackageJson[moduleInOriginalPackageJson];
console.log('\x1B[90m', `Package [${cleanedModuleName}] copied to app package.json`, '\x1B[0m');
if (
moduleInOriginalPackageJson &&
appPackageJson.dependencies[moduleInOriginalPackageJson] !== originalPackageJson.dependencies[moduleInOriginalPackageJson]
) {
appPackageJson.dependencies[moduleInOriginalPackageJson] = originalPackageJson.dependencies[moduleInOriginalPackageJson];
console.log('\x1B[90m', `Package [${moduleInOriginalPackageJson}] copied to app package.json`, '\x1B[0m');
}
}
return node;
Expand Down

0 comments on commit f16faff

Please sign in to comment.