-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix(project-setup): resolve module issues caused by ESM config and al… #7
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||
| /** @type {import('tailwindcss').Config} */ | ||||||||
| const colors = require('tailwindcss/colors'); | ||||||||
| const defaultTheme = require('tailwindcss/defaultTheme'); | ||||||||
| import colors from 'tailwindcss/colors' | ||||||||
| import defaultTheme from 'tailwindcss/defaultTheme' | ||||||||
|
|
||||||||
| // @type {import('tailwindcss').Config} | ||||||||
|
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. Broken JSDoc type annotation — use block-comment form.
🔧 Proposed fix-// `@type` {import('tailwindcss').Config}
+/** `@type` {import('tailwindcss').Config} */
export default {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||
| export default { | ||||||||
| content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], | ||||||||
| darkMode: 'class', | ||||||||
|
|
@@ -38,4 +38,4 @@ export default { | |||||||
| }, | ||||||||
| }, | ||||||||
| plugins: [], | ||||||||
| }; | ||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,16 @@ | ||
| import { defineConfig } from 'vite'; | ||
| import react from '@vitejs/plugin-react-swc'; | ||
| import path from 'path'; | ||
| import react from '@vitejs/plugin-react-swc' | ||
| import { dirname, resolve } from 'path' | ||
| import { fileURLToPath } from 'url' | ||
| import { defineConfig } from 'vite' | ||
|
|
||
| const __filename = fileURLToPath(import.meta.url) | ||
| const __dirname = dirname(__filename) | ||
|
|
||
| // https://vitejs.dev/config/ | ||
| export default defineConfig({ | ||
| plugins: [react()], | ||
| resolve: { | ||
| alias: { | ||
| '@': path.resolve(__dirname, './src'), | ||
| '@': resolve(__dirname, './src'), | ||
| }, | ||
| }, | ||
| }); | ||
| }) |
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.
vite-tsconfig-paths@^6.1.1is incompatible withvite@^4.5.0and is unused.Two concerns on this new dependency:
Peer-dependency mismatch. vite-tsconfig-paths v6 requires Vite ≥ 5.0.0 (see the v6 release notes: "Vite >= 5.0.0 is now the minimum supported version."). This project still declares
"vite": "^4.5.0"on line 60, so installs will emit peer warnings and the plugin is not guaranteed to work at runtime. Either upgrade Vite or pinvite-tsconfig-pathsto a v4.x release compatible with Vite 4.Dead dependency. The plugin is never imported in
frontend/vite.config.ts; the@alias there is still resolved manually viaresolve(__dirname, './src'). If the PR's "Fixed Vite alias resolution" goal was to adopt tsconfig paths, the plugin needs to be wired up; otherwise this dep should be removed.🔧 If the intent is to use tsconfig paths, wire it up in vite.config.ts
import react from '@vitejs/plugin-react-swc' import { dirname, resolve } from 'path' import { fileURLToPath } from 'url' import { defineConfig } from 'vite' +import tsconfigPaths from 'vite-tsconfig-paths' const __filename = fileURLToPath(import.meta.url) const __dirname = dirname(__filename) export default defineConfig({ - plugins: [react()], + plugins: [react(), tsconfigPaths()], resolve: { alias: { '@': resolve(__dirname, './src'), }, }, })Note: with
tsconfigPaths()handling@/*fromtsconfig.json, the manualresolve.aliasentry becomes redundant and can be removed.🤖 Prompt for AI Agents