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

babel-plugin-import-path-replace

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-import-path-replace

Replaces strings predefined string in an import path during transpile.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
504
increased by1%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-import-path-replace

Transforms import statements with a simple string replacement. This can come in handy when your output files are in a different folder structure and the path to imported files needs to be updated.

Install

NPM: npm install --save-dev babel-plugin-import-path-replace

Yarn: yarn add -D babel-plugin-import-path-replace

Usage

Add the following to your .babelrc

{
  "plugins": [
    [
      "import-path-replace",
      {
        "rules": [
          {
            "match": "String to be replaced",
            "replacement": "Replacement string"
          }
        ]
      }
    ]
  ]
}

Example

Plugin
{
  "plugins": [
    [
      "import-path-replace",
      {
        "rules": [
          {
            "match": "../",
            "replacement": "../../"
          }
        ]
      }
    ]
  ]
}
Input
import example from '../example';
Output
import example from '../../example';

FAQs

Package last updated on 10 Jan 2020

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