Skip to content

Commit ab45ae4

Browse files
tkrotoffSpaceK33z
authored andcommitted
CommonJs -> CommonJS
1 parent 959fe80 commit ab45ae4

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

content/concepts/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ contributors:
77

88
You may have noticed that few webpack configurations look exactly alike. This is because **webpack's configuration file is a JavaScript file that exports an object.** This object is then processed by webpack based upon its defined properties.
99

10-
Because it's a standard node.js CommonJs module, you **can do the following**:
10+
Because it's a standard node.js CommonJS module, you **can do the following**:
1111

1212
* import other files via `require(...)`
1313
* use utilities on npm via `require(...)`

content/configuration/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ T> Notice that throughout the configuration we use Node's built-in [path module]
5252
5353
<details><summary>[libraryTarget](/configuration/output#output-librarytarget): "umd", // enum</summary>
5454
[libraryTarget](/configuration/output#output-librarytarget): "umd-module", // ES2015 module wrapped in UMD
55-
[libraryTarget](/configuration/output#output-librarytarget): "commonjs-module", // ES2015 module wrapped in CommonJs
55+
[libraryTarget](/configuration/output#output-librarytarget): "commonjs-module", // ES2015 module wrapped in CommonJS
5656
[libraryTarget](/configuration/output#output-librarytarget): "commonjs2", // exported with module.exports
5757
[libraryTarget](/configuration/output#output-librarytarget): "commonjs", // exported as properties to exports
5858
[libraryTarget](/configuration/output#output-librarytarget): "amd", // defined with AMD defined method

content/configuration/module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ For each different parser options object a new parser is created and plugins can
137137
``` js-with-links
138138
parser: {
139139
amd: false, // disable AMD
140-
commonjs: false, // disable CommonJs
140+
commonjs: false, // disable CommonJS
141141
system: false, // disable System
142142
harmony: false, // disable harmony import/export
143143
requireInclude: false, // disable require.include

content/configuration/target.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Tells webpack which environment the application is targeting. The following valu
2020
| `target` | Description |
2121
| ------------- |------------------------|
2222
| `async-node`| Compile for usage in a Node.js-like environment (uses `fs` and `vm` to load chunks asynchronously) |
23-
| `electron` | Compile for [Electron](http://electron.atom.io/) renderer process, provide a target using `JsonpTemplatePlugin`, `FunctionModulePlugin` for browser environments and `NodeTargetPlugin` and `ExternalsPlugin` for CommonJs and Electron built-in modules. |
23+
| `electron` | Compile for [Electron](http://electron.atom.io/) renderer process, provide a target using `JsonpTemplatePlugin`, `FunctionModulePlugin` for browser environments and `NodeTargetPlugin` and `ExternalsPlugin` for CommonJS and Electron built-in modules. |
2424
| `electron-renderer` | Compile for [Electron](http://electron.atom.io/) for `renderer-process` |
2525
| `node` | Compile for usage in a Node.js-like environment (uses Node.js `require` to load chunks) |
2626
|`node-webkit`| Compile for usage in WebKit and uses JSONP for chunk loading. Allows importing of built-in Node.js modules and [`nw.gui`](http://docs.nwjs.io/en/latest/) (experimental) |

content/get-started/why-webpack.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ webpack however is not the only module bundler out there. If you are choosing be
3333
| AMD `define` | **yes** | **yes** | [deamdify](https://github.com/jaredhanson/deamdify) | yes | no | yes |
3434
| AMD `require` | **yes** | **yes** | no | yes | no | yes |
3535
| AMD `require` loads on demand | **yes** | with manual configuration | no | yes | no | no |
36-
| CommonJs `exports` | **yes** | only wrapping in `define` | **yes** | yes | [commonjs-plugin](https://github.com/rollup/rollup-plugin-commonjs) | yes |
37-
| CommonJs `require` | **yes** | only wrapping in `define` | **yes** | yes | [commonjs-plugin](https://github.com/rollup/rollup-plugin-commonjs) | yes |
38-
| CommonJs `require.resolve` | **yes** | no | no | no | no |
36+
| CommonJS `exports` | **yes** | only wrapping in `define` | **yes** | yes | [commonjs-plugin](https://github.com/rollup/rollup-plugin-commonjs) | yes |
37+
| CommonJS `require` | **yes** | only wrapping in `define` | **yes** | yes | [commonjs-plugin](https://github.com/rollup/rollup-plugin-commonjs) | yes |
38+
| CommonJS `require.resolve` | **yes** | no | no | no | no |
3939
| Concat in require `require("./fi" + "le")` | **yes** | no♦ | no | no | no |
4040
| Debugging support | **SourceUrl, SourceMaps** | not required | SourceMaps | **SourceUrl, SourceMaps** | **SourceUrl, SourceMaps** | SourceMaps |
4141
| Dependencies | 19MB / 127 packages | 11MB / 118 packages | **1.2MB / 1 package** | 26MB / 131 packages | ?MB / 3 packages

content/guides/author-libraries.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export function wordToNum(word) {
2727
return ref.word === word && word.toLowerCase() ? ref.num : accum;
2828
}, -1);
2929
};
30-
3130
```
3231

3332
The usage spec for the library will be as follows.
@@ -41,7 +40,7 @@ import * as webpackNumbers from 'webpack-numbers';
4140
webpackNumbers.wordToNum('Two') // output is 2
4241
...
4342

44-
// CommonJs modules
43+
// CommonJS modules
4544

4645
var webpackNumbers = require('webpack-numbers');
4746

@@ -140,7 +139,7 @@ This means that your library expects a dependency named `lodash` to be available
140139

141140
### Add `libraryTarget`
142141

143-
For widespread use of the library, we would like it to be compatible in different environments, i. e. CommonJs, AMD, Node.js and as a global variable.
142+
For widespread use of the library, we would like it to be compatible in different environments, i. e. CommonJS, AMD, Node.js and as a global variable.
144143

145144
To make your library available for reuse, add `library` property in webpack configuration.
146145

content/guides/shimming.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ contributors:
88

99
`webpack` as a module bundler can understand modules written as ES2015 modules, CommonJS or AMD. But many times, while using third party libraries, we see that they expect dependencies which are global aka `$` for `jquery`. They might also be creating global variables which need to be exported. Here we will see different ways to help webpack understand these __broken modules__.
1010

11-
## Prefer unminified CommonJs/AMD files over bundled `dist` versions.
11+
## Prefer unminified CommonJS/AMD files over bundled `dist` versions.
1212

1313
Most modules link the `dist` version in the `main` field of their `package.json`. While this is useful for most developers, for webpack it is better to alias the src version because this way webpack is able to optimize dependencies better (e.g. when using the [DedupePlugin](/concepts/plugins#DedupePlugin)). However in most cases `dist` works fine as well.
1414

0 commit comments

Comments
 (0)