Open petergaal91 opened 9 months ago
What you can do as a workaround for now is to manually define the outputPath
in devServer config in cypress.config.ts
devServer: {
framework: 'angular',
bundler: 'webpack',
options: {
projectConfig: {
root: './',
sourceRoot: 'src',
buildOptions: {
outputPath: 'dist/browser',
/** other options **/
}
}
}
It's worth noting that those "other options" @bauerbua mentioned, are usually options from angular.json
projects.*whatever*.architect.build.options
(that could be automatically retrieved and appended to the buildOptions
).
In my case it's:
import { defineConfig } from 'cypress';
import * as fs from 'node:fs';
const angularConfig = fs.readFileSync('angular.json', 'utf8');
const angularJson = JSON.parse(angularConfig);
const buildOptions = angularJson.projects.ui.architect.build.options;
export default defineConfig({
e2e: {
projectId: 'ui',
baseUrl: 'http://localhost:4200',
},
component: {
devServer: {
framework: 'angular',
bundler: 'webpack',
options: {
projectConfig: {
root: '',
sourceRoot: 'src',
buildOptions: {
...buildOptions,
outputPath: 'dist/ui',
},
},
},
},
},
});
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
Current behavior
Since angular 17 if we use an application builder the output folder will be "dist/path/browser". If you want to build into the "dist/path" folder - like in the previous version with browser builder - you need to update the outputPath to:
If I do this I get the following error at angular component test config initialization step:
I think outputPath as an object not handled correctly in this case.
Desired behavior
No response
Test code to reproduce
Cypress Version
13.6.4
Node version
20.9.0
Operating System
macOS 14.3.1
Debug Logs
No response
Other
No response