1. babel-preset-solid
Babel preset to transform JSX for Solid.js
babel-preset-solid
Package: babel-preset-solid
Created by: solidjs
Last modified: Mon, 22 Apr 2024 23:28:31 GMT
Version: 1.8.17
License: MIT
Downloads: 489,803
Repository: https://github.com/solidjs/solid/blob/main/packages

Install

npm install babel-preset-solid
yarn add babel-preset-solid

babel-preset-solid

Babel preset to transform JSX into Solid runtime calls.

Install

Via NPM

 npm install babel-preset-solid --save-dev

or Yarn

 yarn add babel-preset-solid --dev

Usage

Make or update your .babelrc config file with the preset:

 {
  "presets": [
    "solid"
  ]
}

Via package.json

    ...
   "babel": {
     "presets": [
       "es2015",
       "solid"
     ],
     "plugins": [
     ]
   },
   ...

Usage for SSR code

When need to transform JSX code to be used on the server, pass the following options

 {
  "presets": [
    ["solid", { "generate": "ssr", "hydratable": true }]
  ]
}

And for the browser build pass the hydratable option as well:

 {
  "presets": [
    ["solid", { "generate": "dom", "hydratable": true }]
  ]
}

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin