Housekeeping: Let's clean up the root directory and move all the config files into /config.
Here's how (should be mostly correct)
| File |
Steps to Update |
vite.config.ts |
In vite.config.ts, add: configFile: path.resolve(__dirname, 'config/vite.config.ts') in the export to make Vite load from /config. |
tsconfig.json |
In package.json, update the tsc script: tsc --project ./config/tsconfig.json. |
tsconfig.node.json |
Update any build scripts in package.json to: tsc --project ./config/tsconfig.node.json. |
tsconfig.app.json |
Update any build scripts in package.json to: tsc --project ./config/tsconfig.app.json. |
tailwind.config.js |
In postcss.config.js or postcss.config.cjs, update the path to: require('./config/tailwind.config.js'). |
.eslintrc.js |
In package.json, add: "eslintConfig": { "extends": "./config/.eslintrc.js" } to point ESLint to /config/.eslintrc.js. |
postcss.config.js |
Change the path in postcss.config.js to: require('./config/tailwind.config.js'). |
postcss.config.cjs |
Change the path in postcss.config.cjs to: require('./config/tailwind.config.js'). |
vitest.config.ts |
Update any vitest.config.ts to reference config/vitest.config.ts if used in your tests. |
Housekeeping: Let's clean up the root directory and move all the config files into /config.
Here's how (should be mostly correct)
vite.config.tsvite.config.ts, add:configFile: path.resolve(__dirname, 'config/vite.config.ts')in the export to make Vite load from/config.tsconfig.jsonpackage.json, update thetscscript:tsc --project ./config/tsconfig.json.tsconfig.node.jsonpackage.jsonto:tsc --project ./config/tsconfig.node.json.tsconfig.app.jsonpackage.jsonto:tsc --project ./config/tsconfig.app.json.tailwind.config.jspostcss.config.jsorpostcss.config.cjs, update the path to:require('./config/tailwind.config.js')..eslintrc.jspackage.json, add:"eslintConfig": { "extends": "./config/.eslintrc.js" }to point ESLint to/config/.eslintrc.js.postcss.config.jspostcss.config.jsto:require('./config/tailwind.config.js').postcss.config.cjspostcss.config.cjsto:require('./config/tailwind.config.js').vitest.config.tsvitest.config.tsto referenceconfig/vitest.config.tsif used in your tests.