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

docs: add docs for the css experiment #6919

Merged
merged 7 commits into from
Jun 24, 2023

Conversation

burhanuday
Copy link
Member

describe your changes...

Closes #6909

Add documentation for experiments.css

@vercel
Copy link

vercel bot commented Jun 17, 2023

@burhanuday is attempting to deploy a commit to the Webpack Docs Team on Vercel.

A member of the Team first needs to authorize it.

@burhanuday burhanuday requested a review from chenxsan June 17, 2023 07:10
@burhanuday burhanuday changed the title docs: add docs for the css experiment [draft] docs: add docs for the css experiment Jun 17, 2023
@burhanuday burhanuday marked this pull request as draft June 17, 2023 07:12

Experimental features:

- Inbuilt support for CSS and CSS Modules. Use the `.module.css` extension for CSS Modules.
Copy link
Member

Choose a reason for hiding this comment

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

We need to clarify what you shoudl set css/auto to enable this, I think in future we should use css/auto by default for any CSS files

Copy link
Member Author

Choose a reason for hiding this comment

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

based on the filename, we automatically use css modules rule
https://github.com/webpack/webpack/blob/dc4d97429b2013f7770ba785721b65cf82c2ef04/lib/config/defaults.js#L728-L729
dont need to set css/auto explicitly

Copy link
Member

Choose a reason for hiding this comment

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

Oh, yeah, missing that

@burhanuday burhanuday changed the title [draft] docs: add docs for the css experiment docs: add docs for the css experiment Jun 20, 2023
@burhanuday burhanuday marked this pull request as ready for review June 20, 2023 14:29
@vercel
Copy link

vercel bot commented Jun 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
webpack-js-org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2023 3:09am

- CSS Modules support: webpack will generate a unique name for each CSS class. Use the `.module.css` extension for CSS Modules.
- <Badge text="5.87.0+" /> Style-specific fields resolution in `package.json` files:
webpack will look for `style` field in `package.json` files and use that if it
exists for imports inside CSS files.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe include an example for this list item?

Copy link
Member

Choose a reason for hiding this comment

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

Btw, did you insert many soft line breaks?

Copy link
Member Author

Choose a reason for hiding this comment

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

Btw, did you insert many soft line breaks?

Strange. The line break gets added by prettier. Was able to remove it from one point but not the other

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe include an example for this list item?

It is a little difficult to explain that point with an example since it has to do with module resolution inside of node_modules folder. Will give it a try

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe include an example for this list item?

Added an example with using bootstrap since they do have that field in their package.json file https://github.com/twbs/bootstrap/blob/main/package.json#L40

Copy link
Member Author

Choose a reason for hiding this comment

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

Btw, did you insert many soft line breaks?

This is happening due to MDX component Badge. VSCode considers the file as markdown and thats just how it formats it for me 😅

src/content/configuration/experiments.mdx Outdated Show resolved Hide resolved
Copy link
Member

@chenxsan chenxsan left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks.

@chenxsan chenxsan merged commit d7f31f1 into webpack:main Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document webpack change: feat: resolve style fields in package json
3 participants