System Information
- Strapi Version: 4.25
- Operating System: MacOS
- Database: Postgres
- Node Version: 18
- NPM Version: 9
- Yarn Version: n/a
For reasons specific to the project I’m working on, I have a file in the root of my Strapi repo called Config
. This file can’t be changed. Strapi’s config
folder conflicts with this. I can work around this by creating a volume on my Mac that allows for case sensitive file names, but this is not great as a) VSCode still gets confused, b) it makes onboarding developers to the project more complex and c) I don’t know if I’m going to cause other issues by doing this.
Ideally I’d be able to rename config/
to strapi-config/
. This is what I’ve tried (with some variations of ./config
, ../config
etc):
- webpack config:
resolve: {
alias: {
config: path.resolve(__dirname, 'strapi-config')
}
}
- package.json:
"exports": {
"./strapi-config/*": "./config/*"
}
also
"imports": {
"config/*": "strapi-config/*"
}
- tsconfig.json
"compilerOptions": {
// ...
"paths": {
"config/*": ["strapi-config/*"]
}
}
Strapi doesn’t pick up on any of the above attempts. I get an error when I run npm run develop
:
Error: Could not find Custom Field: plugin::my-custom-plugin.my-custom-field
I’m assuming the above is because Strapi fails to resolve config/plugins.ts