-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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(webpack-dev-server): add typeRoots to generated tsconfig for angular #27117
Changes from 3 commits
b1e9722
c8ab14f
5e8e19d
cf58585
49923d3
1f896b1
c8b808a
0d9a97a
52954af
a2d3987
d3b8dd2
e8ab248
fe130b7
3b2bb4b
b7c85c6
491a0d2
20112de
9810e56
15aca64
202ccc2
eb9a225
c991d53
aec1dab
67b86c8
1434534
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ import { | |
getAngularCliModules, | ||
getAngularJson, | ||
getProjectConfig, | ||
getTempDir, | ||
toPosix, | ||
} from '../../src/helpers/angularHandler' | ||
import '../support' | ||
|
@@ -215,9 +214,8 @@ const expectLoadsAngularBuildOptions = (buildOptions: BuildOptions) => { | |
const expectGeneratesTsConfig = async (devServerConfig: AngularWebpackDevServerConfig, buildOptions: any) => { | ||
const { projectRoot } = devServerConfig.cypressConfig | ||
let tsConfigPath = await generateTsConfig(devServerConfig, buildOptions) | ||
const tempDir = await getTempDir() | ||
|
||
expect(tsConfigPath).to.eq(path.join(tempDir, 'tsconfig.json')) | ||
expect(tsConfigPath).to.eq(path.join(projectRoot, 'tsconfig.cypress.json')) | ||
|
||
let tsConfig = JSON.parse(await fs.readFile(tsConfigPath, 'utf8')) | ||
|
||
|
@@ -228,11 +226,11 @@ const expectGeneratesTsConfig = async (devServerConfig: AngularWebpackDevServerC | |
outDir: toPosix(path.join(projectRoot, 'out-tsc/cy')), | ||
allowSyntheticDefaultImports: true, | ||
skipLibCheck: true, | ||
types: ['cypress'], | ||
}, | ||
include: [ | ||
toPosix(path.join(projectRoot, 'src/**/*.cy.ts')), | ||
toPosix(path.join(projectRoot, 'src/polyfills.ts')), | ||
toPosix(path.join(projectRoot, 'node_modules/cypress/types/index.d.ts')), | ||
], | ||
}) | ||
|
||
|
@@ -256,11 +254,11 @@ const expectGeneratesTsConfig = async (devServerConfig: AngularWebpackDevServerC | |
outDir: toPosix(path.join(projectRoot, 'out-tsc/cy')), | ||
allowSyntheticDefaultImports: true, | ||
skipLibCheck: true, | ||
types: ['cypress'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So just to confirm, this is the fix? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually that is not the fix. The issue is because we are using a temp file for the We could potentially resolve those paths sourcing |
||
}, | ||
include: [ | ||
toPosix(path.join(projectRoot, 'src/**/*.cy.ts')), | ||
toPosix(supportFile), | ||
toPosix(path.join(projectRoot, 'node_modules/cypress/types/index.d.ts')), | ||
], | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming this was just to get pretty formatting? Still needed since this is dumping to a temp dir?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, but makes it "pretty"er 🤣