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

Support css content in esbuild plugin #361

Merged
merged 1 commit into from Mar 21, 2024
Merged

Support css content in esbuild plugin #361

merged 1 commit into from Mar 21, 2024

Conversation

just-boris
Copy link
Contributor

@just-boris just-boris commented Mar 21, 2024

parse('index.css').name and parse('index.js').name prodiuces the same index key, which overwrites one of the entries.

Use base to prevent conflicts and use index.js/index.css as the keys.

Fixes #360

@ai
Copy link
Owner

ai commented Mar 21, 2024

Lgtm. Do you want to add anything (PR is marked as draft) or we ready for merge?

@just-boris just-boris marked this pull request as ready for review March 21, 2024 13:24
} else {
throw new SizeLimitError('unknownEntry', i)
for (let entry of check.entry) {
let matches = Object.keys(outputs).filter(key => parse(key).name === entry)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sure entry matching still uses path.parse(entry).name as before

@@ -37,7 +37,7 @@ const MESSAGES = {
unknownArg: arg =>
`Unknown argument *${arg}*. Check command for typo and read docs.`,
unknownEntry: entry =>
`Size Limit didn’t find *${entry}* entry in custom Webpack config`,
`Size Limit didn’t find *${entry}* entry in the custom bundler config`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Spent some time in confusion how esbuild change may break anything with webpack config. Let's rename the error message to a more generic

@ai ai merged commit ed7b9ab into ai:main Mar 21, 2024
3 checks passed
@just-boris just-boris deleted the main branch March 22, 2024 14:25
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.

Esbuild plugin produces incorrect numbers when CSS used
2 participants