Skip to content

Commit

Permalink
syntax fix in Inline matchResource
Browse files Browse the repository at this point in the history
syntax fix in Inline matchResource example:
"const match = STYLES_REGEXP.match(source);"  is in the wrong order -> "const match = source.match(STYLES_REGEXP);"
"require.resolve('./getStyle');" is missing the "s" to match with the file getStyles.js
  • Loading branch information
vinicius-caputo authored Aug 24, 2022
1 parent 421c244 commit 9955243
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/content/api/loaders.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ The loader could look like this:
**extract-style-loader/index.js**
```javascript
const getStylesLoader = require.resolve('./getStyle');
const getStylesLoader = require.resolve('./getStyles');

module.exports = function (source) {
if (STYLES_REGEXP.test(source)) {
Expand All @@ -733,7 +733,7 @@ module.exports = function (source) {
```javascript
module.exports = function (source) {
const match = STYLES_REGEXP.match(source);
const match = source.match(STYLES_REGEXP);
return match[0];
};
```
Expand Down

0 comments on commit 9955243

Please sign in to comment.