Skip to content

Commit a23f4c1

Browse files
marioaccskipjack
authored andcommitted
Comments format normalized.
1 parent d9d601d commit a23f4c1

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/content/guides/author-libraries.md

+17-11
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ contributors:
99
- marioacc
1010
---
1111

12-
Aside from applications, webpack can also be used to bundle JavaScript libraries. The following guide is meant for library authors looking to streamline their bundling strategy..
12+
Aside from applications, webpack can also be used to bundle JavaScript libraries. The following guide is meant for library authors looking to streamline their bundling strategy.
1313

1414

1515
## Authoring a Library
@@ -80,15 +80,19 @@ export function wordToNum(word) {
8080
The usage specification for the library use will be as follows:
8181

8282
```javascript
83-
import * as webpackNumbers from 'webpack-numbers'; //ES2015 module import
84-
var webpackNumbers = require('webpack-numbers'); //CommonJS module require
83+
// ES2015 module import
84+
import * as webpackNumbers from 'webpack-numbers';
85+
// CommonJS module require
86+
var webpackNumbers = require('webpack-numbers');
8587
...
86-
webpackNumbers.wordToNum('Two') //ES2015 and CommonJS module use
88+
// ES2015 and CommonJS module use
89+
webpackNumbers.wordToNum('Two');
8790
...
88-
//AMD module require
91+
// AMD module require
8992
require(['webpackNumbers'], function ( webpackNumbers) {
9093
...
91-
webpackNumbers.wordToNum('Two')//AMD module use
94+
// AMD module use
95+
webpackNumbers.wordToNum('Two');
9296
...
9397
});
9498

@@ -102,11 +106,11 @@ The consumer also can use the library loading it with the script tag:
102106
<script src="https://unpkg.com/webpack-numbers"></script>
103107
<script>
104108
...
105-
/* Global variable */
109+
// Global variable
106110
webpackNumbers.wordToNum('Five')
107-
/* Property in the window object */
111+
// Property in the window object
108112
window.webpackNumbers.wordToNum('Five')
109-
//
113+
110114
...
111115
</script>
112116
</html>
@@ -216,7 +220,8 @@ module.exports = {
216220
externals: [
217221
'library/A',
218222
'library/B',
219-
/^library\/.+$/ // everything that starts with "library/"
223+
// everything that starts with "library/"
224+
/^library\/.+$/
220225
]
221226
...
222227
};
@@ -297,7 +302,8 @@ __package.json__
297302
```javascript
298303
{
299304
"main": "dist/webpack-numbers.js",
300-
"module": "src/index.js", // To add as standard module as per https://github.com/dherman/defense-of-dot-js/blob/master/proposal.md#typical-usage
305+
// To add as standard module as per https://github.com/dherman/defense-of-dot-js/blob/master/proposal.md#typical-usage
306+
"module": "src/index.js",
301307
}
302308
```
303309

0 commit comments

Comments
 (0)