rollup / plugins

🍣 The one-stop shop for official Rollup plugins
MIT License
3.57k stars 568 forks source link

fix(dynamic-import-vars): escape special glob characters #1636

Closed sapphi-red closed 7 months ago

sapphi-red commented 7 months ago

Rollup Plugin Name: dynamic-import-vars

This PR contains:

Are tests included?

Breaking Changes?

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

refs https://github.com/vitejs/vite/issues/11824

Description

dynamicImportToGlob(parse('import(./${foo}/(foo).js)')) returned ./*/(foo).js. But because ( has a meaning in glob syntax, it meant a different thing. This PR add a escape process to handle special characters like these.

shellscape commented 7 months ago

thanks!