-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
Ross Morsali edited this page May 22, 2022
·
4 revisions
npm install -D babel-plugin-jsx-template-vars
This should be added to your pre-render build.
{
test: /\.(js|jsx|tsx|ts)$/,
exclude: /node_modules/,
loader: "babel-loader",
options: {
plugins: [
'babel-plugin-jsx-template-vars'
],
presets: []
}
},
Using .babelrc
will likely affect all of your builds, so it might not be the best option as we need different configurations for different builds.
{
"plugins": [
"babel-plugin-jsx-template-vars"
]
}
Note You will still need to add this transform to your existing builds with the option
tidyOnly: true
so that the.templateVars
properties are removed from your production/development code, e.g.
plugins: [
[ 'babel-plugin-jsx-template-vars', { tidyOnly: true } ]
],
- Overview
-
Installation
- Creating a pre-render build
- Output languages
- Variable types
- Example with all supported features