Skip to content

justin-schroeder/babel-plugin-transform-import-meta-x

Repository files navigation

babel-plugin-transform-import-meta-x

This is a Babel plugin that transforms import.meta subproperty access to any other literal value.

This module is derived from the babel-plugin-transform-import-meta project.

Usage:

{
  "plugins": [
    "babel-plugin-transform-import-meta-x",
    { replacements: { foobar: '{}' } }
  ]
}

Run on the following code it will produce the following output:

// src.js
console.log(import.meta.foobar);
// output:
console.log({});