Skip to content

chore(deps): update dependency vite-plugin-static-copy to v4 - #431

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/vite-plugin-static-copy-4.x
Open

chore(deps): update dependency vite-plugin-static-copy to v4#431
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/vite-plugin-static-copy-4.x

Conversation

@renovate

@renovate renovate Bot commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
vite-plugin-static-copy ^3.4.0^4.1.1 age confidence

Release Notes

sapphi-red/vite-plugin-static-copy (vite-plugin-static-copy)

v4.1.1

Compare Source

Patch Changes
  • #​240 671579b Thanks @​saif-shines! - Use each environment's resolved build.outDir when copying static assets during build. Previously the plugin kept only the last configResolved config, so multi-environment setups (for example Astro with separate client and SSR output directories) could copy files into the wrong folder.

v4.1.0

Compare Source

Minor Changes
  • #​251 7672842 Thanks @​sapphi-red! - Add name property to the rename object form and allow rename functions to return a RenameObject. The name property replaces the file's basename (filename + extension), and can be combined with stripBase to both flatten directory structure and rename the file in one step. Rename functions can now return { name, stripBase } objects instead of only strings, making it easier to declaratively control output paths from dynamic rename logic.

    // node_modules/lib/dist/index.js → vendor/lib.js
    { src: 'node_modules/lib/dist/index.js', dest: 'vendor', rename: { name: 'lib.js', stripBase: true } }
    
    // src/pages/events/test.html → dist/events/index.html
    { src: 'src/pages/**/*.html', dest: 'dist/', rename: { stripBase: 2, name: 'index.html' } }

v4.0.1

Compare Source

Patch Changes
  • #​249 c6bf44c Thanks @​sapphi-red! - Fix absolute dest paths being nested under the output directory

    When dest was an absolute path and the source file had a directory component (structured output), the path was incorrectly converted to a relative path, causing files to be nested under the build output directory instead of being copied to the specified absolute path.

    { src: 'foo/foo.txt', dest: '/home/user/my-repo/bar' }

    Before: /home/user/my-repo/dist/home/user/my-repo/bar/foo/foo.txt
    After: /home/user/my-repo/bar/foo/foo.txt

  • #​247 d3af79e Thanks @​sapphi-red! - Fix rename.stripBase to work correctly with ../ paths

    Previously, stripBase counted .. as directory segments, causing incorrect output paths when copying from parent directories.

    { src: '../../src/pages/**/*.html', dest: 'dist/', rename: { stripBase: 2 } }

    Before: dist/src/pages/events/test.html
    After: dist/events/test.html

    { src: '../../src/pages/**/*.html', dest: 'dist/', rename: { stripBase: true } }

    Before: dist/src/pages/events/test.html
    After: dist/test.html

v4.0.0

Compare Source

Major Changes
  • #​235 b2edc86 Thanks @​sapphi-red! - Simplify glob behavior and always preserve directory structure.

    Breaking changes:

    • Only files are matched. Glob patterns no longer match directory entries. Previously, matching a directory would recursively copy it via fs.cp, which caused files to be copied twice when using ** patterns.
    • Directory patterns are auto-expanded. src: 'assets' now automatically expands to match all files inside the directory, using tinyglobby's built-in expandDirectories option. No migration needed for this pattern alone.
    • structured option removed. Directory structure is now always preserved in the output. The structured option has been removed entirely. Use rename: { stripBase: true } to flatten output paths when needed.
  • #​237 6129008 Thanks @​sapphi-red! - Drop support for Vite 5

  • #​238 9766e42 Thanks @​sapphi-red! - Drop support for Node 18, 20, 21, 23. The new support range is ^22.0.0 || >= 24.0.0.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 3 times, most recently from 81ac2ce to ac4e989 Compare March 26, 2026 16:24
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 4 times, most recently from fdc164a to 07154a4 Compare April 8, 2026 18:40
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 3 times, most recently from 61f910d to 94e8bed Compare April 14, 2026 10:18
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch from 94e8bed to c047745 Compare April 19, 2026 14:03
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 5 times, most recently from 98b7a4f to 907d26c Compare April 29, 2026 14:10
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 5 times, most recently from 5529207 to e6a2bef Compare May 18, 2026 17:46
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 4 times, most recently from b2482ca to e8a89f5 Compare May 29, 2026 07:09
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 3 times, most recently from 731d3f1 to e0eab8c Compare June 6, 2026 10:05
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 2 times, most recently from 7e61742 to e6b4295 Compare June 17, 2026 06:13
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 3 times, most recently from daabfa7 to 5ac29b0 Compare June 30, 2026 04:10
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 3 times, most recently from d3f87b4 to 93cb281 Compare July 16, 2026 19:17
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch from 93cb281 to ee3d6fd Compare July 20, 2026 16:03
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 3 times, most recently from f9c03d5 to 0ebe636 Compare July 30, 2026 15:14
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 3 times, most recently from 707a659 to c599e95 Compare August 7, 2026 15:36
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 2 times, most recently from 223627d to 62c87ac Compare August 14, 2026 18:13
@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch 3 times, most recently from 4523d57 to 17eb454 Compare August 28, 2026 14:54

@pikachuren pikachuren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论:请求修改 — 该升级为破坏性变更,需同步调整 vite.config.ts

CI 的 Build Check 失败不是偶发问题,而是 v4 破坏性变更的直接后果:

[plugin vite-plugin-static-copy:build]
Error: No file was found to copy on node_modules/monaco-editor/min/* src.

原因在 v4.0.0 的 major changes 中有明确说明:

Only files are matched. Glob patterns no longer match directory entries.
structured option removed. Directory structure is now always preserved in the output.

当前配置里的 target 依赖旧的 glob 语义:

{ src: "node_modules/monaco-editor/min/*", dest: "static/monaco-editor" }

min/* 下既有文件也有目录(vs/ 等),v3 会把目录整个递归拷走,v4 只匹配文件,于是 monaco 的 vs/ 完全不会被复制。这里报的是「没有文件可拷」,说明该 pattern 在 v4 下的匹配结果已经和预期完全不同。

另外 v4 现在总是保留目录结构(structured 被移除),即使把 pattern 改成能匹配到文件,产物的目录层级也可能和 v3 不一致,进而影响 static/monaco-editor 下的实际布局。monaco 对自身资源路径敏感,布局变了编辑器会加载失败。

建议这样处理:

  1. 把 monaco 的 target 改为 src: "node_modules/monaco-editor/min"(v4 会自动展开目录内所有文件),或显式用 min/**/* 并配合 rename.stripBase 校正层级;
  2. 同理复查其余几个 target(katex 的 dist/fonts/* 等)在 v4 下的产出路径;
  3. 本地跑一次完整 pnpm build(非 lite),确认 dist/static/monaco-editor 下的文件树与升级前一致,再确认 Markdown 编辑器和 KaTeX 渲染正常。

补充一点兼容性信息:v4 同时 drop 了 Vite 5 和 Node 18/20/21/23 支持,新支持范围是 ^22.0.0 || >= 24.0.0。仓库 CI 用的是 Node 24.20.0,这点没问题,但如果有贡献者在更低版本 Node 上开发需要提前知会。

vite.config.ts 同步调整并且 CI 转绿之前,这个 PR 不宜合并。

@renovate
renovate Bot force-pushed the renovate/vite-plugin-static-copy-4.x branch from 17eb454 to b518490 Compare September 2, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant