Neovictorian Paisley Menswear

    babel-preset-vite
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.4 • Public • Published

    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

    With a configuration file (Recommended)

    Without options:

    {
      "presets": ["babel-preset-vite"]
    }

    With options:

    {
      "presets": [
        [
          "babel-preset-vite",
          {
            "env": false, // defaults to true
            "glob": 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.

    You can read more about configuring preset options here

    Install

    npm i babel-preset-vite

    DownloadsWeekly Downloads

    8,745

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    9.92 kB

    Total Files

    11

    Last publish

    Collaborators

    • mpeyper
    • jacobmgevans
    • nobrayner
    • osrg