webpack-contrib / mini-css-extract-plugin

Lightweight CSS extraction plugin
MIT License
4.65k stars 389 forks source link

feat: add support for link preload/prefetch #1043

Closed FogelAI closed 4 months ago

FogelAI commented 1 year ago

This PR contains a:

Motivation / Use-Case

This pull request adds webpackPrefetch and webpackPreload magic comments support of webpack at import() for css files, per this issue: https://github.com/webpack-contrib/mini-css-extract-plugin/issues/142.

It is also an alternative realization of https://github.com/webpack-contrib/mini-css-extract-plugin/pull/344 and https://github.com/webpack-contrib/mini-css-extract-plugin/pull/488 pull requests, which are not merged and are not active.

See also https://github.com/webpack/webpack/pull/7056 pull request of webpack repository.

Breaking Changes

No breaking changes.

Additional Info

linux-foundation-easycla[bot] commented 1 year ago

CLA Not Signed

grybykm commented 1 year ago

@alexander-akait is it ok to merge this one?

alexander-akait commented 6 months ago

@grybykm @FogelAI Sorry for delay, yes, code is fine, but we need tests for it

FogelAI commented 5 months ago

Hi @alexander-akait I have added the tests. Please note that the commit https://github.com/webpack-contrib/mini-css-extract-plugin/pull/1043/commits/b785fd8eff6e09073f5d79f7dae498a3a2f62c32 is the CSS version of https://github.com/webpack/webpack/pull/17497/commits/f5dab1b6e65d6c590e61207395ab2dc6caadf86a.

alexander-akait commented 5 months ago

@FogelAI Can you accept CLA?