Nerfing Powerful Megalomaniacs

    babel-plugin-transform-import-meta
    TypeScript icon, indicating that this package has built-in type declarations

    2.1.1 • Public • Published

    babel-plugin-transform-import-meta

    Transforms import.meta for nodejs environments. This plugin replaces any occurrence of import.meta.url.

    console.log(import.meta.url);

    And outputs code compatible with CommonJS

    console.log(require('url').pathToFileURL(__filename).toString());

    Installation

    npm install --save-dev babel-plugin-transform-import-meta

    After the plugin is installed, configure it in package.json

      "babel": {
        "presets": [
          "@babel/preset-env",
        ],
        "plugins": [
          "babel-plugin-transform-import-meta"
        ]
      },
    

    Credits

    Based on a previous project "babel-plugin-import-meta" by The Polymer Authors

    Install

    npm i babel-plugin-transform-import-meta

    DownloadsWeekly Downloads

    31,395

    Version

    2.1.1

    License

    BSD

    Unpacked Size

    8.95 kB

    Total Files

    6

    Last publish

    Collaborators

    • javiertury