Skip to content

Commit

Permalink
fix(node): cleanup generated paths for node libs (#14674)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndcunningham committed Jan 27, 2023
1 parent 3f4a956 commit 3cdaacf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/node/src/generators/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,19 @@ function updateProject(tree: Tree, options: NormalizedSchema) {
const project = readProjectConfiguration(tree, options.name);
const { libsDir } = getWorkspaceLayout(tree);

const rootProject = options.projectRoot === '.' || options.projectRoot === '';

project.targets = project.targets || {};
project.targets.build = {
executor: `@nrwl/js:${options.compiler}`,
outputs: ['{options.outputPath}'],
options: {
outputPath: `dist/${libsDir}/${options.projectDirectory}`,
outputPath: joinPathFragments(
'dist',
rootProject
? options.projectDirectory
: `${libsDir}/${options.projectDirectory}`
),
tsConfig: `${options.projectRoot}/tsconfig.lib.json`,
packageJson: `${options.projectRoot}/package.json`,
main: `${options.projectRoot}/src/index` + (options.js ? '.js' : '.ts'),
Expand Down

0 comments on commit 3cdaacf

Please sign in to comment.