File tree 3 files changed +17
-2
lines changed
3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ jobs:
171
171
run : pnpm --filter '*${{ matrix.e2e-framework }}*' --filter '!*bare*' --workspace-concurrency 1 test:e2e
172
172
173
173
- name : Cypress component testing for projects without Vitest
174
+ working-directory : ./playground
174
175
if : ${{ contains(matrix.e2e-framework, 'cypress') }}
175
176
run : pnpm --filter '*cypress*' --filter '!*vitest*' --workspace-concurrency 1 test:unit
176
177
Original file line number Diff line number Diff line change @@ -628,7 +628,7 @@ async function init() {
628
628
}
629
629
630
630
if ( argv . bare ) {
631
- removeCSSImport ( root , needsTypeScript )
631
+ removeCSSImport ( root , needsTypeScript , needsCypressCT )
632
632
if ( needsRouter ) {
633
633
emptyRouterConfig ( root , needsTypeScript )
634
634
}
Original file line number Diff line number Diff line change @@ -20,10 +20,24 @@ export function trimBoilerplate(rootDir: string) {
20
20
}
21
21
}
22
22
23
- export function removeCSSImport ( rootDir : string , needsTypeScript : boolean ) {
23
+ export function removeCSSImport (
24
+ rootDir : string ,
25
+ needsTypeScript : boolean ,
26
+ needsCypressCT : boolean ,
27
+ ) {
24
28
// Remove CSS import in the entry file
25
29
const entryPath = path . resolve ( rootDir , needsTypeScript ? 'src/main.ts' : 'src/main.js' )
26
30
replaceContent ( entryPath , ( content ) => content . replace ( "import './assets/main.css'\n\n" , '' ) )
31
+
32
+ if ( needsCypressCT ) {
33
+ const ctSetupPath = path . resolve (
34
+ rootDir ,
35
+ needsTypeScript ? 'cypress/support/component.ts' : 'cypress/support/component.js' ,
36
+ )
37
+ replaceContent ( ctSetupPath , ( content ) =>
38
+ content . replace ( "import '@/assets/main.css'" , "// import '@/assets/main.css'" ) ,
39
+ )
40
+ }
27
41
}
28
42
29
43
export function emptyRouterConfig ( rootDir : string , needsTypeScript : boolean ) {
You can’t perform that action at this time.
0 commit comments