Skip to content

Commit 3b8ac83

Browse files
EugeneHlushkomontogeek
authored andcommitted
docs(api) fix broken link and apply consistent formatting (sq in js) (#2898)
1 parent 4af645c commit 3b8ac83

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/content/api/node.mdx

+11-10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ contributors:
66
- rynclark
77
- byzyk
88
- wizardofhogwarts
9+
- EugeneHlushko
910
---
1011

1112
webpack provides a Node.js API which can be used directly in Node.js runtime.
@@ -39,11 +40,11 @@ import webpack from 'webpack';
3940
The imported `webpack` function is fed a webpack [Configuration Object](/configuration/) and runs the webpack compiler if a callback function is provided:
4041

4142
``` js-with-links
42-
const webpack = require("webpack");
43+
const webpack = require('webpack');
4344
4445
webpack({
4546
// [Configuration Object](/configuration/)
46-
}, (err, [stats](#stats-object)) => {
47+
}, (err, stats) => { // [Stats Object](#stats-object)
4748
if (err || stats.hasErrors()) {
4849
// [Handle errors here](#error-handling)
4950
}
@@ -96,7 +97,7 @@ Calling the `run` method on the `Compiler` instance is much like the quick run
9697
method mentioned above:
9798

9899
``` js-with-links
99-
const webpack = require("webpack");
100+
const webpack = require('webpack');
100101
101102
const compiler = webpack({
102103
// [Configuration Object](/configuration/)
@@ -119,7 +120,7 @@ watch(watchOptions, callback);
119120
```
120121

121122
``` js-with-links
122-
const webpack = require("webpack");
123+
const webpack = require('webpack');
123124
124125
const compiler = webpack({
125126
// [Configuration Object](/configuration/)
@@ -129,7 +130,7 @@ const watching = compiler.watch({
129130
// Example [watchOptions](/configuration/watch/#watchoptions)
130131
aggregateTimeout: 300,
131132
poll: undefined
132-
}, (err, [stats](#stats-object)) => {
133+
}, (err, stats) => { // [Stats Object](#stats-object)
133134
// Print watch/build result here...
134135
console.log(stats);
135136
});
@@ -207,7 +208,7 @@ Returns compilation information as a JSON object. `options` can be either a
207208
string (a preset) or an object for more granular control:
208209

209210
``` js-with-links
210-
stats.toJson("minimal"); // [more options: "verbose", etc](/configuration/stats).
211+
stats.toJson('minimal'); // [more options: 'verbose', etc](/configuration/stats).
211212
```
212213

213214
``` js
@@ -241,7 +242,7 @@ stats.toString({
241242
Here’s an example of `stats.toString()` usage:
242243

243244
``` js-with-links
244-
const webpack = require("webpack");
245+
const webpack = require('webpack');
245246
246247
webpack({
247248
// [Configuration Object](/configuration/)
@@ -273,7 +274,7 @@ webpack([
273274
{ entry: './index1.js', output: { filename: 'bundle1.js' } },
274275
{ entry: './index2.js', output: { filename: 'bundle2.js' } }
275276
], (err, [stats](#stats-object)) => {
276-
process.stdout.write(stats.toString() + "\n");
277+
process.stdout.write(stats.toString() + '\n');
277278
})
278279
```
279280

@@ -294,7 +295,7 @@ For a good error handling, you need to account for these three types of errors:
294295
Here’s an example that does all that:
295296

296297
``` js-with-links
297-
const webpack = require("webpack");
298+
const webpack = require('webpack');
298299
299300
webpack({
300301
// [Configuration Object](/configuration/)
@@ -337,7 +338,7 @@ const MemoryFS = require('memory-fs');
337338
const webpack = require('webpack');
338339

339340
const fs = new MemoryFS();
340-
const compiler = webpack({ /* options*/ });
341+
const compiler = webpack({ /* options */ });
341342

342343
compiler.outputFileSystem = fs;
343344
compiler.run((err, stats) => {

0 commit comments

Comments
 (0)