0.0.1-beta.5 • Published 4 days ago

vite-plugin-import-glob-default v0.0.1-beta.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 days ago

vite-plugin-import-glob-default

description: import eager in build, import lazy in dev

Usage

import.meta.globDefault('a file path', config);

// => transform to

function __vite_get_path_dynamic_default(modules) {
  const [[key, value]] = Object.entries(modules);
  return modules[key];
}

// config default { import: 'default', eager: config.command === 'build' }
__vite_get_path_dynamic_default(import.meta.glob('a file path', config));

Try it now

LICENSE

MIT License © 2022 zwkang

0.0.1-beta.5

4 days ago

0.0.1-beta.3

10 days ago

0.0.1-beta.4

10 days ago

0.0.1-beta.2

2 months ago

0.0.1-beta.1

2 months ago

0.0.1-beta.0

2 months ago