@babel/plugin-syntax-import-meta

NOTE: This plugin is included in @babel/preset-env, in ES2020

Installation

  1. npm install --save-dev @babel/plugin-syntax-import-meta

Usage

  1. {
  2. "plugins": ["@babel/plugin-syntax-import-meta"]
  3. }

Via CLI

  1. babel --plugins @babel/plugin-syntax-import-meta script.js

Via Node API

  1. require("@babel/core").transformSync("code", {
  2. plugins: ["@babel/plugin-syntax-import-meta"]
  3. });