Skip to main content

@babel/plugin-syntax-import-reflection

note

Syntax only

This plugin only enables Babel to parse this syntax. Babel does not support transforming this syntax

This plugin enables Babel to parse import reflections:

JavaScript
import module foo from "./foo.wasm";

Installation

npm install --save-dev @babel/plugin-syntax-import-reflection

Usage

babel.config.json
{
"plugins": ["@babel/plugin-syntax-import-reflection"]
}

Via CLI

Shell
babel --plugins @babel/plugin-syntax-import-reflection script.js

Via Node API

JavaScript
require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-syntax-import-reflection"]
});