Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gatsby): remove
.js
suffixes in require() to allow transpilation (
#5087) In earlier v1, one could write files such as `gatsby-config` in typescript and use babel to transpile the file into js on the fly via `babel-node --presets @babel/preset-typescript --extensions '.ts' gatsby develop`. However, it's no longer possible in recent releases. The reason is that the current implementation put a `.js` suffix on each require(`gatsby-${env}.js`), which blocks `gatsby-{$env}` files being transpiled from other languages via babel. The PR addresses this problem by removing the unnecessary suffix and preserving the integrity. Signed-off-by: Alvis HT Tang <alvis@hilbert.space>
- Loading branch information