From 63928986b61c2b106bfce96ccdb9cd7f10d280ac Mon Sep 17 00:00:00 2001 From: Bhawna Patnaik <44670836+mitchell-frost@users.noreply.github.com> Date: Thu, 16 Jul 2020 17:19:54 +0530 Subject: [PATCH] update loading CSS --- src/content/guides/asset-management.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/content/guides/asset-management.md b/src/content/guides/asset-management.md index 86838d3b564d..770f6363bd98 100644 --- a/src/content/guides/asset-management.md +++ b/src/content/guides/asset-management.md @@ -86,6 +86,9 @@ __webpack.config.js__ + }, }; ``` +Module loaders can be chained. Each loader in the chain applies transformations to the processed resource. A chain is executed in reverse order. The first loader passes its result (resource with applied transformations) to the next one, and so forth. Finally, webpack expects JavaScript to be returned by the last loader in the chain. + +The above order or loaders should be maintained with 'style-loader' coming first and then, 'css-loader'. If this convention is not followed, webpack is likely to throw errors. T> webpack uses a regular expression to determine which files it should look for and serve to a specific loader. In this case, any file that ends with `.css` will be served to the `style-loader` and the `css-loader`.