2021年3月9日星期二

Gatsby Resolve Directory Imports

Using Gatsby.js I'd like to resolve components by directory without using an index.js to proxy/resolve file names. I've seen this done though I'm not sure how, probably a Babel/Webpack. config option. Ignore the gatsby-plugin-alias-imports below, has nothing to do with the question.

I'd like to import Layout like this:

import { Layout } from '@components/ui'  

Instead of this:

import Layout from '@components/ui/Layout'  
https://stackoverflow.com/questions/66556116/gatsby-resolve-directory-imports March 10, 2021 at 07:14AM

没有评论:

发表评论