Allow gatsby-*.js
of a plugin to be placed in a custom directory
#32132
Unanswered
alvis
asked this question in
Ideas / Feature Requests
Replies: 1 comment
-
Hi, we're planning to introduce this feature soon. I can't give you an exact date yet but we will be leveraging the exports field in package.json As an example by setting the following fields in your package.json "name": "something",
"version": "1.0.0",
"exports": {
"./gatsby-node.js": "./lib/gatsby-node.js"
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, gatsby requires all
gatsby-*.js
files presents on the root directory of a plugin.While it may be fine for pure js, it violates the best practice if the source of the plugin requires compilation such as those written in typescript. Most of these plugin may have their compiled
gatsby-*.js
files stored in other directories such aslib
. As such, many such plugins have to place a dummygatsby-*.js
files on the root with content like:Since ususally in
package.json
of these plugin contains the output directory inmain
(usuallylib/index.js
), can we get gatsby to look forgatsby-*.js
in the same directory ofmain
if they are not present in the root directory?Beta Was this translation helpful? Give feedback.
All reactions