@babel/plugin-syntax-pipeline-operator
note
Syntax only
It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use plugin-proposal-pipeline-operator to both parse and transform this syntax.
Installation
- npm
- Yarn
- pnpm
npm install @babel/plugin-syntax-pipeline-operator
yarn add @babel/plugin-syntax-pipeline-operator
pnpm add @babel/plugin-syntax-pipeline-operator
Usage
With a configuration file (Recommended)
With ^^
topic token:
babel.config.json
{
"plugins": [
[ "@babel/plugin-syntax-pipeline-operator", { "topicToken": "^^" } ]
]
}
With @@
topic token:
babel.config.json
{
"plugins": [
[ "@babel/plugin-syntax-pipeline-operator", { "topicToken": "@@" } ]
]
}
Via CLI
Because this plugin requires a configuration option, it cannot be directly configured from the CLI. Use a config file instead with the CLI, to add and configure this plugin.
Via Node API
With ^^
topic token:
JavaScript
require("@babel/core").transformSync("code", {
plugins: [
[ "@babel/plugin-syntax-pipeline-operator", { topicToken: "^^" } ],
],
});
With @@
topic token:
JavaScript
require("@babel/core").transformSync("code", {
plugins: [
[ "@babel/plugin-syntax-pipeline-operator", { topicToken: "@@" } ],
],
});