Skip to content

Commit

Permalink
chore: use relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanpowell88 committed Jun 26, 2023
1 parent c8ab14f commit cf58585
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions npm/webpack-dev-server/src/helpers/angularHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,29 @@ export async function generateTsConfig (devServerConfig: AngularWebpackDevServer

const specPattern = Array.isArray(cypressConfig.specPattern) ? cypressConfig.specPattern : [cypressConfig.specPattern]

const getProjectFilePath = (...fileParts: string[]): string => toPosix(path.join(...fileParts))

const includePaths = [...specPattern.map((pattern) => getProjectFilePath(projectRoot, pattern))]
const includePaths = [...specPattern]

if (cypressConfig.supportFile) {
includePaths.push(toPosix(cypressConfig.supportFile))
const supportPath = toPosix(path.relative(workspaceRoot, cypressConfig.supportFile))

includePaths.push(supportPath)
}

if (buildOptions.polyfills) {
const polyfills = Array.isArray(buildOptions.polyfills)
? buildOptions.polyfills.filter((p: string) => devServerConfig.options?.projectConfig.sourceRoot && p.startsWith(devServerConfig.options?.projectConfig.sourceRoot))
: [buildOptions.polyfills]

includePaths.push(...polyfills.map((p: string) => getProjectFilePath(workspaceRoot, p)))
includePaths.push(...polyfills.map((p: string) => p))
}

// Source the relative tsconfig extends path from the buildOptions.tsConfig property or default to ./tsconfig.json
const tsConfigExtendPath = toPosix(buildOptions.tsConfig ? `./${buildOptions.tsConfig}` : './tsconfig.json')

const tsConfigContent = JSON.stringify({
extends: getProjectFilePath(projectRoot, buildOptions.tsConfig ?? 'tsconfig.json'),
extends: tsConfigExtendPath,
compilerOptions: {
outDir: getProjectFilePath(projectRoot, 'out-tsc/cy'),
outDir: './out-tsc/cy',
allowSyntheticDefaultImports: true,
skipLibCheck: true,
types: ['cypress'],
Expand Down

0 comments on commit cf58585

Please sign in to comment.