strapi-community / strapi-plugin-transformer

A plugin for Strapi Headless CMS that provides the ability to transform the API request or response.
https://market.strapi.io/plugins/strapi-plugin-transformer
MIT License
140 stars 22 forks source link

Plugin configuration needs to be inside .config/env/ #98

Open jiv-e opened 1 year ago

jiv-e commented 1 year ago

Many people have reported problems with the plugin not working as documented. I had the same problem. I installed the plugin. Added ./config/plugins.js file as documented and nothing happened.

I found out that plugins.js file inside ./config folder is ignored by Strapi at least in the case you are having a ./config/env folder.

See: https://github.com/strapi/strapi/blob/d999ad0b00ff427885462051cdc96626b7946472/packages/core/strapi/src/core/app-configuration/index.ts#L54

I managed to fix the issue by moving the plugins.js file inside my env folder's respective environment folders (development, production, ...).

Like this.

Before:

./config
  plugins.js

After:

./config
  /env
    /development
      plugins.js
    /production
      plugins.js

Could you add this to the documentation?

ComfortablyCoding commented 1 year ago

It is possible they changed this but per the docs (and from what I have observed in the past) the envs should be merged with the base one.

I will check this and add any relevant info to the docs as needed.

ukashazia commented 11 months ago

Many people have reported problems with the plugin not working as documented. I had the same problem. I installed the plugin. Added ./config/plugins.js file as documented and nothing happened.

I found out that plugins.js file inside ./config folder is ignored by Strapi at least in the case you are having a ./config/env folder.

See: https://github.com/strapi/strapi/blob/d999ad0b00ff427885462051cdc96626b7946472/packages/core/strapi/src/core/app-configuration/index.ts#L54

I managed to fix the issue by moving the plugins.js file inside my env folder's respective environment folders (development, production, ...).

Like this.

Before:

./config
  plugins.js

After:

./config
  /env
    /development
      plugins.js
    /production
      plugins.js

Could you add this to the documentation?

this doesn't seem to work either

Edit: My bad, i was exporting 2 modules at once in plugins.js file.