Skip to content

feat: update Vite configuration to conditionally exclude JS modules while including CSS files in the build process#268

Merged
zzcr merged 1 commit intodevfrom
zzc/fix-runtime-cdn-error-0105
Jan 6, 2026
Merged

feat: update Vite configuration to conditionally exclude JS modules while including CSS files in the build process#268
zzcr merged 1 commit intodevfrom
zzc/fix-runtime-cdn-error-0105

Conversation

@zzcr
Copy link
Member

@zzcr zzcr commented Jan 5, 2026

feat: 更新Vite配置以有条件地排除JS模块,同时在构建过程中将css文件都打包到style.css文件中

Summary by CodeRabbit

  • Chores
    • Version bumped to 0.0.10-beta.6
    • Build configuration improvements for asset bundling and external dependency handling

✏️ Tip: You can customize this high-level summary in your review settings.

…hile including CSS files in the build process
@coderabbitai
Copy link

coderabbitai bot commented Jan 5, 2026

Walkthrough

The pull request bumps the package version to 0.0.10-beta.6 and refactors the Vite build configuration. The rollupOptions.external now uses a function for selective module exclusion instead of a static array, and assetFileNames logic is updated to improve CSS file detection during bundling.

Changes

Cohort / File(s) Summary
Version Update
packages/next-remoter/package.json
Version bumped from 0.0.10-beta.5 to 0.0.10-beta.6
Build Configuration
packages/next-remoter/vite.config.ts
rollupOptions.external converted from static array to function that conditionally excludes 'vue' and '@opentiny/' modules; assetFileNames refactored to use assetInfo.names?.[0] for CSS detection and returns 'style.css' for CSS assets

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A version hops forward with beta-six cheer,
Build config gets smarter, bundling is clear,
Vue stays external, opentiny too,
CSS flows cleanly through assets anew! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: updating Vite configuration to conditionally exclude JS modules while including CSS files in the build process, which directly aligns with the modifications to rollupOptions.external and assetFileNames in vite.config.ts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch zzc/fix-runtime-cdn-error-0105

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1fbcfe and 37716e1.

📒 Files selected for processing (2)
  • packages/next-remoter/package.json
  • packages/next-remoter/vite.config.ts
🔇 Additional comments (3)
packages/next-remoter/package.json (1)

3-3: LGTM! Version bump aligns with the configuration changes.

The version increment to 0.0.10-beta.6 appropriately reflects the build configuration updates in this PR.

packages/next-remoter/vite.config.ts (2)

58-73: No CSS preprocessor handling issue found.

The external function correctly handles CSS files with id.endsWith('.css'). This project does not use CSS preprocessors (sass, less, stylus), so the concern about .scss, .sass, .less, or .styl files is not applicable. The implementation is appropriate for the project's dependencies and import patterns.

Likely an incorrect or invalid review comment.


76-85: API usage is correct; multiple CSS file scenario is unlikely in current configuration.

The assetInfo.names?.[0] approach is the correct modern Rollup API—assetInfo.name (singular) is indeed deprecated. The comment appropriately justifies this choice.

The concern about multiple CSS files overwriting is theoretically valid but mitigated by the current build configuration: a single entry point with no code splitting means Rollup will consolidate all CSS into one asset. In this case, hardcoding 'style.css' is safe. However, if future refactoring introduces code splitting or multiple entry points, this could become an issue. Consider adding a comment noting this assumption or using a pattern like 'styles/[name]-[hash][extname]' for better robustness.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zzcr zzcr merged commit 658cd20 into dev Jan 6, 2026
2 checks passed
@kagol kagol deleted the zzc/fix-runtime-cdn-error-0105 branch January 8, 2026 08:20
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

Comments