Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-plugin-direct-import

Gatsby plugin to use Babel plugin direct import and make it tree shaking.

Install

npm install --save gatsby-plugin-direct-import

How to use

Add the plugin to your gatsby-config.js.

plugins: [
  {
    resolve: `gatsby-plugin-direct-import`,
    options: {
      packages: [
        "my-package-name",
        {
          "name": "my-package-name/sub-package",
          "indexFile": "my-package-name/sub-package/index.es.js"
        }
      ],
    },
  },
];
© 2023 Gatsby, Inc.