@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
- Yarn
- pnpm
npm install --save-dev @babel/plugin-syntax-import-reflection
yarn add --dev @babel/plugin-syntax-import-reflection
pnpm add --save-dev @babel/plugin-syntax-import-reflection
Usage
With a configuration file (Recommended)
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"]
});