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(shadow-to-light): correctly transform imported .css #26

Merged
merged 3 commits into from
Mar 5, 2024

Conversation

nolanlawson
Copy link
Collaborator

This fixes #25 (error when trying to delete the same .css file more than once) as well as fixing an additional issue, which is that shadow-to-light was not properly transforming:

import sheet from './sheet.css'

to

import sheet from './sheet.scoped.css'

There is an additional issue where we don't handle import stylesheet from './notReferencedByTemplate.css' but I'll open a separate issue for that.

# intentionally test with a relative file path since that's what most users will do
cd /tmp/lwc-codemod-tests
node "$CLI_PATH" "${TRANSFORM}" "${TRANSFORM}/${DIR}"
cd -
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is not strictly necessary for the repro, but I feel like it's a good safety measure. Most users will do npx lwc-codemod <mod> ./path/to/something rather than provide a full absolute path.

@nolanlawson nolanlawson merged commit d52e524 into main Mar 5, 2024
3 checks passed
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.

ENOENT: no such file or directory for CSS file when HTML file is imported into JS
2 participants