Skip to content

Commit 18e8e38

Browse files
authored
docs: remove redundant backslash escapes (#4188)
These had previously introduced for *.mdx files but seem to no longer be needed.
1 parent ef658e0 commit 18e8e38

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

src/content/api/node.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ contributors:
1111
- toshihidetagami
1212
- chenxsan
1313
- jamesgeorge007
14+
- textbook
1415
---
1516

1617
webpack provides a Node.js API which can be used directly in Node.js runtime.
@@ -278,7 +279,7 @@ webpack([
278279
{ entry: './index1.js', output: { filename: 'bundle1.js' } },
279280
{ entry: './index2.js', output: { filename: 'bundle2.js' } }
280281
], (err, stats) => { // [Stats Object](#stats-object)
281-
process.stdout.write(stats.toString() + '\\n');
282+
process.stdout.write(stats.toString() + '\n');
282283
})
283284
```
284285

src/content/concepts/loaders.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ contributors:
1616
- lukasgeiter
1717
- furkle
1818
- jamesgeorge007
19+
- textbook
1920
---
2021

2122
Loaders are transformations that are applied to the source code of a module. They allow you to pre-process files as you `import` or “load” them. Thus, loaders are kind of like “tasks” in other build tools and provide a powerful way to handle front-end build steps. Loaders can transform files from a different language (like TypeScript) to JavaScript or load inline images as data URLs. Loaders even allow you to do things like `import` CSS files directly from your JavaScript modules!
@@ -36,8 +37,8 @@ __webpack.config.js__
3637
module.exports = {
3738
module: {
3839
rules: [
39-
{ test: /\\.css$/, use: 'css-loader' },
40-
{ test: /\\.ts$/, use: 'ts-loader' }
40+
{ test: /\.css$/, use: 'css-loader' },
41+
{ test: /\.ts$/, use: 'ts-loader' }
4142
]
4243
}
4344
};
@@ -65,7 +66,7 @@ module.exports = {
6566
module: {
6667
rules: [
6768
{
68-
test: /\\.css$/,
69+
test: /\.css$/,
6970
use: [
7071
// [style-loader](/loaders/style-loader)
7172
{ loader: 'style-loader' },

src/content/configuration/index.mdx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ contributors:
1717
- EugeneHlushko
1818
- bigdawggi
1919
- anshumanv
20+
- textbook
2021
---
2122

2223
Out of the box, webpack won't require you to use a configuration file. However, it will assume the entry point of your project is `src/index.js` and will output the result in `dist/main.js` minified and optimized for production.
@@ -267,7 +268,7 @@ module.exports = {
267268
// filename template for HMR chunks
268269
hotUpdateGlobal: "hmrUpdateFunction", // string
269270
// the name of the global variable used to load hot update chunks
270-
sourcePrefix: "\\t", // string
271+
sourcePrefix: "\t", // string
271272
// prefix module sources in bundle for better readablitity
272273
// but breaks multi-line template strings
273274
hashFunction: "md4", // string (default)
@@ -286,7 +287,7 @@ module.exports = {
286287
// rules for modules (configure loaders, parser options, etc.)
287288
{
288289
// Conditions:
289-
test: /\\.jsx?$/,
290+
test: /\.jsx?$/,
290291
include: [
291292
path.resolve(__dirname, "app")
292293
],
@@ -302,18 +303,18 @@ module.exports = {
302303
// - Try to avoid exclude and prefer include
303304
// Each condition can also receive an object with "and", "or" or "not" properties
304305
// which are an array of conditions.
305-
issuer: /\\.css$/,
306+
issuer: /\.css$/,
306307
issuer: path.resolve(__dirname, "app"),
307-
issuer: { and: [ /\\.css$/, path.resolve(__dirname, "app") ] },
308-
issuer: { or: [ /\\.css$/, path.resolve(__dirname, "app") ] },
309-
issuer: { not: [ /\\.css$/ ] },
310-
issuer: [ /\\.css$/, path.resolve(__dirname, "app") ], // like "or"
308+
issuer: { and: [ /\.css$/, path.resolve(__dirname, "app") ] },
309+
issuer: { or: [ /\.css$/, path.resolve(__dirname, "app") ] },
310+
issuer: { not: [ /\.css$/ ] },
311+
issuer: [ /\.css$/, path.resolve(__dirname, "app") ], // like "or"
311312
// conditions for the issuer (the origin of the import)
312313
<advancedConditions "#">
313314
<default>
314315
/* Advanced conditions (click to show) */
315316
</default>
316-
resource: /\\.css$/,
317+
resource: /\.css$/,
317318
// matches the resource of the module, behaves equal to "test" and "include"
318319
compiler: /html-webpack-plugin/,
319320
// matches the name of the child compilation
@@ -329,7 +330,7 @@ module.exports = {
329330
// matches information from the package.json
330331
mimetype: "text/javascript",
331332
// matches the mimetype in DataUris
332-
realResource: /\\.css$/,
333+
realResource: /\.css$/,
333334
// matches the resource but ignores when resource was been renamed
334335
resourceFragment: "#blah",
335336
// matches the fragment part of the resource request
@@ -402,15 +403,15 @@ module.exports = {
402403
/* Advanced module configuration (click to show) */
403404
</default>
404405
noParse: [
405-
/special-library\\.js$/
406+
/special-library\.js$/
406407
],
407408
// do not parse this module
408409
unknownContextRequest: ".",
409410
unknownContextRecursive: true,
410-
unknownContextRegExp: /^\\.\\/.*$/,
411+
unknownContextRegExp: /^\.\/.*$/,
411412
unknownContextCritical: true,
412413
exprContextRequest: ".",
413-
exprContextRegExp: /^\\.\\/.*$/,
414+
exprContextRegExp: /^\.\/.*$/,
414415
exprContextRecursive: true,
415416
exprContextCritical: true,
416417
wrappedContextRegExp: /.*/,
@@ -482,7 +483,7 @@ module.exports = {
482483
mainFields: ["main"],
483484
// properties that are read from description file
484485
// when a folder is requested
485-
restrictions: [ /\\.js$/, path.resolve(__dirname, "app") ],
486+
restrictions: [ /\.js$/, path.resolve(__dirname, "app") ],
486487
// To successful resolve the result must match these criteria
487488
cache: true, // boolean
488489
// enable safe caching of resolving
@@ -597,7 +598,7 @@ module.exports = {
597598
externals: ["react", /^@angular/],
598599
</default>
599600
externals: "react", // string (exact match)
600-
externals: /^[a-z\\-]+($|\\/)/, // Regex
601+
externals: /^[a-z\-]+($|\/)/, // Regex
601602
externals: { // object
602603
angular: "this angular", // this["angular"]
603604
react: { // UMD
@@ -720,7 +721,7 @@ module.exports = {
720721
// number of asset lines to display
721722
cachedAssets: false,
722723
// show assets that are caching in output
723-
excludeAssets: /\\.png$/,
724+
excludeAssets: /\.png$/,
724725
// hide some assets
725726
groupAssetsByPath: true,
726727
// group assets by their path in the output directory
@@ -786,7 +787,7 @@ module.exports = {
786787
// show modules that were cached
787788
orphanModules: true,
788789
// show modules that are not referenced in optimized graph anymore
789-
excludeModules: /\\.css$/,
790+
excludeModules: /\.css$/,
790791
// hide some modules
791792
reasons: true,
792793
// show the reasons why modules are included
@@ -945,7 +946,7 @@ module.exports = {
945946
"my-name": {
946947
// define groups of modules with specific
947948
// caching behavior
948-
test: /\\.sass$/,
949+
test: /\.sass$/,
949950
type: "css/mini-extract",
950951
951952
<cacheGroupAdvancedSelectors "#">

0 commit comments

Comments
 (0)