Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): remove side-effect imports from page metadata #6376

Merged
merged 2 commits into from
Aug 5, 2022
Merged

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves nuxt/nuxt#14351

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Currently any CSS imports or other imports with side effects in meta chunk are preserved. This change strips them, which enables bundle splitting for page CSS.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added bug Something isn't working πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels Aug 5, 2022
@danielroe danielroe requested a review from pi0 August 5, 2022 10:02
@danielroe danielroe self-assigned this Aug 5, 2022
@netlify
Copy link

netlify bot commented Aug 5, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit d68f5ff
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62eced3e84989e0009ee3e4e

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

LGTM. Only let's remember to improve mlly findStaticImports using tokenizer method to remove false positives. Otherwise if someone uses 'import 'xyz' in a string statement of meta for some reason, it will be stripped (really edge but still valid)

@pi0 pi0 changed the title perf(nuxt): remove CSS imports from page metadata fix(nuxt): remove side-effect imports from page metadata Aug 5, 2022
@pi0 pi0 merged commit 60656df into main Aug 5, 2022
@pi0 pi0 deleted the perf/css-macros branch August 5, 2022 16:35
@pi0 pi0 mentioned this pull request Aug 9, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bug Something isn't working πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

code splitting on build is not working
2 participants