🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@hqjs/babel-plugin-transform-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

@hqjs/babel-plugin-transform-paths

Transform global and local paths to full path with server URL

latest
Source
npmnpm
Version
0.0.7
Version published
Maintainers
1
Created
Source

https://hqjs.org

Transform global and local paths to full path with server URL

Installation

npm install hqjs@babel-plugin-transform-paths

Usage

{
  "plugins": [["hqjs@babel-plugin-transform-paths", {
    "basePath": "",
    "baseURI": "http://localhost:8080",
    "dirname": "/path/to/module",
    "removeNodeModules": false,
    "transformAbsolute": false
  }]]
}

where

  • basePath - basic path to a module, '' by default
  • baseURI - server baseURI
  • dirname - path to module relative to basePath, meant to resolve relative imports
  • removeNodeModules - should /node_modules part of the path be removed
  • transformAbsolute - should absolute path be transformed

URL will be constructed this way:

  • ./rest -> ${baseURI}${basePath}${dirname}${rest}
  • @/rest -> ${baseURI}${basePath}/${rest}
  • /rest -> ${baseURI}${basePath}/${rest} or /${rest} depending on transformAbsolute option
  • /node-modules/rest -> ${baseURI}${basePath}${rest} or ${baseURI}${basePath}node_modules/${rest} depending on removeNodeModules option

Transformation

Plugin resolves relative paths ./..., ../..., node_modules paths /node_modules/... and vue absolute paths @/... to full URL.

Keywords

babel

FAQs

Package last updated on 26 Sep 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