Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: Corrects CSS output being overwritten when .cjs ext used#919

Merged
ForsakenHarmony merged 2 commits into
masterdevelopit/microbundle:masterfrom
fix/cjs-cssdevelopit/microbundle:fix/cjs-cssCopy head branch name to clipboard
Mar 3, 2022
Merged

fix: Corrects CSS output being overwritten when .cjs ext used#919
ForsakenHarmony merged 2 commits into
masterdevelopit/microbundle:masterfrom
fix/cjs-cssdevelopit/microbundle:fix/cjs-cssCopy head branch name to clipboard

Conversation

@rschristian

Copy link
Copy Markdown
Collaborator

Fixes #883

@changeset-bot

changeset-bot Bot commented Dec 22, 2021

Copy link
Copy Markdown

馃 Changeset detected

Latest commit: 97c9a46

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

This PR includes changesets to release 1 package
Name Type
microbundle 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

@MinJieLiu

Copy link
Copy Markdown

When can this pr be merged

Comment thread src/utils.js
return camelCase(identifier);
}

export const EXTENSION = /(\.(umd|cjs|es|m))?\.([cm]?[tj]sx?)$/;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Names are hard... 馃槄

Certainly open to suggestions

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Also (horrifyingly) supports the .cts and .mts extensions, as it looks like TS might head down that path

Comment thread src/index.js
Comment on lines -485 to +487
options.output.replace(
/(\.(umd|cjs|es|m))?\.(mjs|[tj]sx?)$/,
'.css',
),
options.output.replace(EXTENSION, '.css'),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the only regex that actually needed to be corrected. #802 missed this when adding in support, which is totally understandable given that the regex existed in 3 separate locations. Hopefully extracting this out makes it easier to handle.

@ForsakenHarmony ForsakenHarmony merged commit 392d63e into master Mar 3, 2022
@ForsakenHarmony ForsakenHarmony deleted the fix/cjs-css branch March 3, 2022 17:04
@preact-bot preact-bot mentioned this pull request Mar 3, 2022
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.

.cjs extension in main package.json field causes imported CSS file output to be overwritten

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.