Catalog npm
Back to packageRELEASE DETAILS

0.0.0-semantically-released

npm

@0kzh/babel-plugin-transform-vite-meta-glob

babel plugin that emulates vite's import.meta.glob import.meta.globEager functionality

babelglobglobeagerimportmetapluginvite
Published17 Jan 2023
Direct dependencies9
Transitive dependenciesNot calculated

README

Current package documentation

babel-plugin-transform-vite-meta-glob

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.

Example

In

const modules = import.meta.glob('./path/to/files/**/*')

const eagerModules = import.meta.globEager('./path/to/files/**/*')

Out

For the purposes of this example, assume there are 3 files, files1.js, files2.js and file3.js at the path of ./path/to/files/ relative the files being transformed.

const modules = {
  './path/to/files/file1.js': () => import('./path/to/files/file1.js'),
  './path/to/files/file2.js': () => import(('./path/to/files/file2.js'),
  './path/to/files/file3.js': () => import(('./path/to/files/file3.js')
}

const eagerModules = {
  './path/to/files/file1.js': require('./path/to/files/file1.js'),
  './path/to/files/file2.js': require('./path/to/files/file2.js'),
  './path/to/files/file3.js': require('./path/to/files/file3.js')
}

Installation

npm install --save-dev babel-plugin-transform-vite-meta-glob

Usage

{
  "plugins": ["babel-plugin-transform-vite-meta-glob"]
}

Via CLI

babel --plugins babel-plugin-transform-vite-meta-glob script.js

Via Node API

require('@babel/core').transformSync('code', {
  plugins: ['babel-plugin-transform-vite-meta-glob']
})

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 9

Native requirements
9 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@babel/runtime
Environment
{
  "local_name": "@babel/runtime",
  "alias": false,
  "peer_metadata": null
}
^7.13.9runtime
@types/babel__core
Environment
{
  "local_name": "@types/babel__core",
  "alias": false,
  "peer_metadata": null
}
^7.1.12runtime
glob
Environment
{
  "local_name": "glob",
  "alias": false,
  "peer_metadata": null
}
^8.0.1runtime
@babel/core
Environment
{
  "local_name": "@babel/core",
  "alias": false,
  "peer_metadata": null
}
^7.13.8development
@types/babel-plugin-tester
Environment
{
  "local_name": "@types/babel-plugin-tester",
  "alias": false,
  "peer_metadata": null
}
^9.0.1development
@types/glob
Environment
{
  "local_name": "@types/glob",
  "alias": false,
  "peer_metadata": null
}
^7.1.3development
babel-plugin-tester
Environment
{
  "local_name": "babel-plugin-tester",
  "alias": false,
  "peer_metadata": null
}
^10.0.0development
kcd-scripts
Environment
{
  "local_name": "kcd-scripts",
  "alias": false,
  "peer_metadata": null
}
^12.0.0development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^4.2.2development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-RiRZetcJSnlZI9NPo1y4J2CQ/YGDaPcqTZpjcFwE+3c4p7oo5rVpgCoE2tzQhd8DurFp7nvQUojN7anVtRjYOA==",
  "shasum": "c1895cd5ae075329124b806bd76153f8b87af98c",
  "tarball": "https://registry.npmjs.org/@0kzh/babel-plugin-transform-vite-meta-glob/-/babel-plugin-transform-vite-meta-glob-0.0.0-semantically-released.tgz",
  "fileCount": 11,
  "unpackedSize": 13793,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIDND9Lnb2wtbNsYAAUOleoFXoc6FmqmnxAgwG6qV93IGAiEAsw+/iRY+/CLb+A0kRT5Kvp4/e3SGux/SBUqJKUD/nlU="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxu1gACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsJQ//RnjefANyl8hEy2uoQrw0dOOMBPiAofmu7jZbtSgX78ntrf3I\r\n4y0tr3EknSqXr+LYLSshShjzukuBsMfoKbI4wGYtIvqOKjAN7BMkXZIN3bYV\r\nJL5NLGmjHoLqHRV8BigwQL1x5ApIfanlhYc9mXPyKjK5S5LeVoiW0ctBSzM/\r\nrt3Xin1nAaU8jNeApF2d84dM7LpZ0+yQYiKQg8Zp8FWgCgDClqiX5oMDZW18\r\nSjrx976vCEaGcvw59vNXI8JMpZa9hq9M8OcvqVSZE6YGNuqye48bLpFi77QH\r\nMs1isfZJdlAP4MoUBqENMR/pLvm4ykkpqKavzmIw0ko7pKfRZmYG7a8niGmX\r\nApwWYFW1rAWmlL3u7usLY/nKVXnb0CkgQR9pU+waEVBgNBJ0QJ7rZ1SJhqFv\r\nvCm+3gWCMfl8Q2OneOgLvUFGXvPSmGFVZzIO/5c+F1jNCGXA+wx9wjTvmSJg\r\nMqqIq5R6yhHUOMolk6YzZvBkW6izDqwpZI7G5ecCmKeoYU1mkomU2FCbJ+k6\r\nVq37teOnwTpe0oAyuO3EG3rczJuC0q3/YLL61uvoEc39lBhZ1QZ014hF/mHP\r\nTTPXYg/ODJGp50YtrN/LNqpfWurdMOSJp31rznGGYB7WHc7chWWkK+EnRkWn\r\nwWqJL5gPOBO7YEZ3BnniHPo9nkPYXNU9g2w=\r\n=fv78\r\n-----END PGP SIGNATURE-----\r\n"
}

Repository

PENDING
opensourceraidguild/babel-vite

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:12 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:f47ea31b9a143abfb305e07c2a719a2fd59e94c19190d5418ad70218aec9bc99

Other collected versions

View all collected versions →