Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(storybook): path on Win for tsconfig location in angular.json #4080

Merged
merged 1 commit into from Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -168,7 +168,7 @@ describe('Update 10-3-0', () => {
\\"path\\": \\"./tsconfig.spec.json\\"
},
{
\\"path\\": \\"./.storybook/tsconfig.json\\"
\\"path\\": \\".storybook/tsconfig.json\\"
}
]
}
Expand Down Expand Up @@ -220,7 +220,7 @@ describe('Update 10-3-0', () => {
\\"path\\": \\"./tsconfig.spec.json\\"
},
{
\\"path\\": \\"./.storybook/tsconfig.json\\"
\\"path\\": \\".storybook/tsconfig.json\\"
}
]
}
Expand Down
Expand Up @@ -13,6 +13,7 @@ import {
} from '@nrwl/workspace';

import { getTsConfigContent, isFramework } from '../../utils/utils';
import { normalize } from '@angular-devkit/core';

interface ProjectDefinition {
root: string;
Expand Down Expand Up @@ -55,9 +56,8 @@ function updateLintTarget(
const paths = {
tsConfig: path.join(options.projectConfig.root, 'tsconfig.json'),
tsConfigLib: path.join(options.projectConfig.root, 'tsconfig.lib.json'),
tsConfigStorybook: path.join(
options.projectConfig.root,
'.storybook/tsconfig.json'
tsConfigStorybook: normalize(
path.join(options.projectConfig.root, '.storybook/tsconfig.json')
),
};

Expand Down Expand Up @@ -102,7 +102,9 @@ function updateLintTarget(
(ref) => ref.path !== './.storybook/tsconfig.json'
)
) {
tsConfig.main.references.push({ path: './.storybook/tsconfig.json' });
tsConfig.main.references.push({
path: normalize('./.storybook/tsconfig.json'),
});
tree.overwrite(paths.tsConfig, serializeJson(tsConfig.main));
}

Expand Down