-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a problem with css-dev-only-do-not-override (antd) (#362)
- Loading branch information
1 parent
9d664b1
commit c6984d4
Showing
4 changed files
with
14 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,11 @@ | ||
import { defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
import fs from 'fs/promises'; | ||
import { vi } from 'vitest' | ||
|
||
export default defineConfig({ | ||
esbuild: { | ||
loader: "jsx", | ||
include: /src\/.*\.jsx?$/, | ||
exclude: [], | ||
}, | ||
optimizeDeps: { | ||
esbuildOptions: { | ||
plugins: [ | ||
{ | ||
name: "load-js-files-as-jsx", | ||
setup(build) { | ||
build.onLoad({ filter: /src\\.*\.js$/ }, async (args) => ({ // i modified the regex here | ||
loader: "jsx", | ||
contents: await fs.readFile(args.path, "utf8"), | ||
})); | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
plugins: [react()], | ||
test: { | ||
globals: true, | ||
environment: 'jsdom', | ||
setupFiles: './vitest-setup.ts' | ||
} | ||
}) | ||
// mock router for 'useParams' | ||
vi.mock('react-router-dom'); | ||
|
||
vi.mock('antd', async () => { | ||
const antd = await vi.importActual('antd'); | ||
// @ts-expect-error importActualの型付けをしていない | ||
antd.theme.defaultConfig.hashed = false; | ||
return antd; | ||
}); |