babel-preset-vite
/
1.0.0
babel-preset-vite 1.0.0
Install from the command line:
Learn more about npm packages
$ npm install @fond-of/babel-preset-vite@1.0.0
Install via package.json:
"@fond-of/babel-preset-vite": "1.0.0"
About this version
Please note: this plugin is intended to provide an approximation of some of Vite specific transformations when running the code in non-Vite environment, for example, running tests with a NodeJS based test runner.
The functionality within these transformations should not be relied upon in production.
This preset includes the following plugins:
- babel-plugin-transform-vite-meta-env
- babel-plugin-transform-vite-meta-glob
- babel-plugin-transform-vite-meta-hot
npm install --save-dev babel-preset-vite
Without options:
{
"presets": ["babel-preset-vite"]
}
With options:
{
"presets": [
[
"babel-preset-vite",
{
"env": false, // defaults to true
"glob": false, // defaults to true
"hot": false // defaults to true
}
]
]
}
babel --presets babel-preset-vite
require('@babel/core').transformSync('code', {
presets: ['babel-preset-vite']
})
boolean
, defaults to true
Toggles whether or not to perform
import.meta.env
transformations.
boolean
, defaults to true
Toggles whether or not to perform
import.meta.glob
and import.meta.globEager
transformations.
boolean
, defaults to true
Toggles whether or not to perform import.meta.hot
transformations.
You can read more about configuring preset options here
Details
- babel-preset-vite
- fond-of
- 5 months ago
- MIT
- 10 dependencies
Assets
- babel-preset-vite-1.0.0.tgz
Download activity
- Total downloads 596
- Last 30 days 161
- Last week 32
- Today 0