Skip to content

Fix compiled css filename#1925

Draft
xtan-atlas wants to merge 3 commits into
masterfrom
fix-compiled-css-filename
Draft

Fix compiled css filename#1925
xtan-atlas wants to merge 3 commits into
masterfrom
fix-compiled-css-filename

Conversation

@xtan-atlas

@xtan-atlas xtan-atlas commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What is this change?

change compiled css file name to 'compiled.' + hash(stylesheet) + '.css'

Why are we making this change?

Predictable file name pattern allows upstream to control whether to inline or not

How are we making this change?

(Optional.)


PR checklist

Don't delete me!

I have...

  • Updated or added applicable tests
  • Updated the documentation in website/
  • Added a changeset (if making any changes that affect Compiled's behaviour)

@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9679672

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@compiled/parcel-optimizer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlify Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy Preview for compiled-css-in-js canceled.

Name Link
🔨 Latest commit 9679672
🔍 Latest deploy log https://app.netlify.com/projects/compiled-css-in-js/deploys/6a616b8f67d0c20008d55f11

}

const cssFileName = basename(bundle.displayName, '.html') + '.' + hash(stylesheet) + '.css';
const cssFileName = 'compiled.' + hash(stylesheet) + '.css';

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.

this will cause collisions if you have a new entry. Maybe something like:

Suggested change
const cssFileName = 'compiled.' + hash(stylesheet) + '.css';
const cssFileName = 'compiled.' + basename(bundle.displayName, '.html') + hash(stylesheet) + '.css';

or a configurable filename?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

configurable filename would be better, I guess from parcelrc. If you don't mind I will leave it to you to do it properly :)

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.

2 participants