1.2.3 • Published 5 years ago

@favi_ty/babel-plugin-esm-url-resolver v1.2.3

Weekly downloads
23
License
WTFPL
Repository
-
Last release
5 years ago

@favi_ty/babel-plugin-esm-url-resolver

add the js extension so that the import path can be executed as a URL

  • only transpiling relative path. (may be only your repository sources)
  • if the path already has an extensions, do nothing.
  • if you importing index files, it must be specified /index in the path strings.

Installation

yarn add -D @favi_ty/babel-plugin-esm-url-resolver

Usage

"plugins": ["@favi_ty/babel-plugin-esm-url-resolver"]

In

import * as src from "./module1";

Out

import * as src from "./module1.js";

Options

dirs?: String[]

include the path that starts with one of the values in the transformation target

{
  "dirs": ["/src"]
}

in:

import lib from "/src/lib";
import lib2 from "/src/node/lib2";
import lib3 from "src/node/lib3"; // that's not transform!

out:

import lib from "/src/lib.js";
import lib2 from "/src/node/lib2.js";
import lib3 from "src/node/lib3"; // that's not transform!
1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago