New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-plugin-tsconfig-paths

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-tsconfig-paths

Adds support for tsconfig paths to Gatsby build process

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

TSConfig Paths plugin for Gatsby

Description

This plugin will provide support for paths configured in your tsconfig by using tsconfig-paths-webpack-plugin.


How to install

  • Install gatsby-plugin-tsconfig-paths in your project
npm install -D gatsby-plugin-tsconfig-paths
  • Include the plugin in your gatsby-config.js.
// gatsby-config.js
module.exports = {
  plugins: [
    ...,
    `gatsby-plugin-tsconfig-paths`
  ]
}
  • Configure using any of tsconfig-paths-webpack-plugin's options

Available Options

  • For list of options that are available for this plugin, see the tsconfig-paths-webpack-plugin documentation at the following:

https://github.com/dividab/tsconfig-paths-webpack-plugin#options

for example:

// gatsby-config.js
module.exports = {
  plugins: [
    ...,
    {
      resolve: `gatsby-plugin-tsconfig-paths`,
      options: {
        configFile: `${__dirname}/tsconfig.json`,
        silent: true,
        colors: false
      },
    }
  ]
}

Default options

  • configFile: Defaults to the tsconfig.json located at your process's current working directory.
  • extensions: Defaults to ['.ts', '.tsx', '.js', '.jsx'].

Additional information

According to the documentation for tsconfig-paths-webpack-plugin, if the tsconfig option allowJs is set, then this plugin's extensions option should be set to match webpack's. Because typescript transpiling is usually done in the same set of loaders as javascript, this plugin will set the webpack extensions to match the default described above, using the resolvableExtensions endpoint.

Keywords

FAQs

Package last updated on 09 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc