diff --git a/playground/vue-lib/__tests__/vue-lib.spec.ts b/playground/vue-lib/__tests__/vue-lib.spec.ts index d001fe88..c3ba7923 100644 --- a/playground/vue-lib/__tests__/vue-lib.spec.ts +++ b/playground/vue-lib/__tests__/vue-lib.spec.ts @@ -1,34 +1,27 @@ import path from 'node:path' import type { Rollup } from 'vite' import { build } from 'vite' -import * as vite from 'vite' import { describe, expect, test } from 'vitest' -const isRolldownVite = 'rolldownVersion' in vite - describe('vue component library', () => { - // skip this test for now with rolldown-vite due to https://github.com/oxc-project/oxc/issues/10033 - test.skipIf(isRolldownVite)( - 'should output tree shakeable css module code', - async () => { - // Build lib - await build({ - logLevel: 'silent', - configFile: path.resolve(__dirname, '../vite.config.lib.ts'), - }) - // Build app - const { output } = (await build({ - logLevel: 'silent', - configFile: path.resolve(__dirname, '../vite.config.consumer.ts'), - })) as Rollup.RollupOutput - const { code } = output.find( - (e) => e.type === 'chunk' && e.isEntry, - ) as Rollup.OutputChunk - // Unused css module should be treeshaked - expect(code).toContain('styleA') // styleA is used by CompA - expect(code).not.toContain('styleB') // styleB is not used - }, - ) + test('should output tree shakeable css module code', async () => { + // Build lib + await build({ + logLevel: 'silent', + configFile: path.resolve(__dirname, '../vite.config.lib.ts'), + }) + // Build app + const { output } = (await build({ + logLevel: 'silent', + configFile: path.resolve(__dirname, '../vite.config.consumer.ts'), + })) as Rollup.RollupOutput + const { code } = output.find( + (e) => e.type === 'chunk' && e.isEntry, + ) as Rollup.OutputChunk + // Unused css module should be treeshaked + expect(code).toContain('styleA') // styleA is used by CompA + expect(code).not.toContain('styleB') // styleB is not used + }) test('should inject css when cssCodeSplit = true', async () => { // Build lib diff --git a/vitest.config.e2e.ts b/vitest.config.e2e.ts index 0320e77d..d4edeb20 100644 --- a/vitest.config.e2e.ts +++ b/vitest.config.e2e.ts @@ -1,6 +1,5 @@ import { resolve } from 'node:path' -import { defaultExclude, defineConfig } from 'vitest/config' -import * as vite from 'vite' +import { defineConfig } from 'vitest/config' const timeout = process.env.CI ? 50000 : 30000 @@ -16,11 +15,6 @@ export default defineConfig({ }, test: { include: ['./playground/**/*.spec.[tj]s'], - exclude: [ - ...defaultExclude, - // plugin-legacy is not supported with rolldown-vite - ...('rolldownVersion' in vite ? ['./playground/vue-legacy/**/*'] : []), - ], setupFiles: ['./playground/vitestSetup.ts'], globalSetup: ['./playground/vitestGlobalSetup.ts'], testTimeout: timeout,