Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@0kzh/babel-preset-vite

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0kzh/babel-preset-vite

babel preset that emulates vite's non-standard functionality

  • 0.0.3-semantically-released
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

babel-preset-vite

Build Status codecov version downloads MIT License

PRs Welcome Code of Conduct Discord

Watch on GitHub Star on GitHub Tweet

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:

Installation

npm install --save-dev babel-preset-vite

Usage

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
      }
    ]
  ]
}

Via CLI

babel --presets babel-preset-vite

Via Node API

require('@babel/core').transformSync('code', {
  presets: ['babel-preset-vite']
})

Options

env

boolean, defaults to true

Toggles whether or not to perform import.meta.env transformations.

glob

boolean, defaults to true

Toggles whether or not to perform import.meta.glob and import.meta.globEager transformations.

hot

boolean, defaults to true

Toggles whether or not to perform import.meta.hot transformations.

You can read more about configuring preset options here

Keywords

FAQs

Package last updated on 17 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc