Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): add rollup plugin to switch out .scss?lit during build #11337

Conversation

annawen1
Copy link
Member

@annawen1 annawen1 commented Jan 4, 2024

Related Ticket(s)

Closes #11347

Description

Currently the CWC build fails due to the vite requiring a parameter added to the style imports (ie. ./button.scss?lit). This PR uses the @rollup/plugin-alias plugin to point the style imports to the corresponding scss file during build.

This PR also updates the babel-plugin-resource-js-paths.js file to swap out .scss?lit imports to the generated .css.js file in the es build

Changelog

New

  • installs @rollup/plugin-alias to direct the style imports with the ?lit query param to the corresponding scss file

Changed

  • update babel-plugin-resource-js-paths.js file to look for .scss?lit imports
  • path update cleanup for story and test files

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Jan 4, 2024

@annawen1 annawen1 closed this Jan 5, 2024
@annawen1 annawen1 reopened this Jan 5, 2024
@annawen1 annawen1 marked this pull request as ready for review January 8, 2024 14:47
@annawen1 annawen1 requested a review from a team as a code owner January 8, 2024 14:47
@annawen1 annawen1 requested review from emyarod and IgnacioBecerra and removed request for a team January 8, 2024 14:47
@annawen1 annawen1 merged commit d471864 into carbon-design-system:feat/cwc-storybook-7-vite Jan 8, 2024
7 of 14 checks passed
@annawen1 annawen1 deleted the fix/rollup-plugin-scss-paths branch January 8, 2024 17:08
kennylam pushed a commit to kennylam/carbon-for-ibm-dotcom that referenced this pull request Jun 11, 2024
…arbon-design-system#11337)

* fix(build): add custom rollup plugin

* fix(build): add the lit parameter to style imports

* fix(build): use rollup alias plugin

* chore(prettier): prettier

* fix(build): add back text nullable file

* fix(build): removing the text nullable file

* fix(syntax): remove comment from license
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.

[carbon-web-components]: Update build for CWC to account for vite style imports
3 participants