Dschungelabenteuer / vite-plugin-entry-shaking

Mimic tree-shaking behaviour when importing code from an entry file in development mode.
MIT License
118 stars 8 forks source link

feat: Glob Pattern #36

Closed moushicheng closed 5 months ago

moushicheng commented 10 months ago

Target Option support Glob pattern to Match path

export type EntryTarget = string | { path?: string; glob?: string; globOptions: Options };

choose fast-glob to analyse glob , it also used by vite API 'import.meta.glob'

Usage

Using glob to match path

globOptions to give options, see https://github.com/mrmlnc/fast-glob#options-3

    await EntryShakingPlugin({
      targets: [{ glob: 'src/utils/*.ts' , globOptions:{  ignore: ['**/node_modules/**'] } }],
    }),
changeset-bot[bot] commented 10 months ago

⚠️ No Changeset found

Latest commit: a25da69215b9bdacd36601159e4e55e059de3735

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR