From a23f4c1b5ec105993348a866a5233d329a28eba3 Mon Sep 17 00:00:00 2001 From: Mario Contreras Date: Thu, 31 Aug 2017 17:15:35 -0500 Subject: [PATCH] Comments format normalized. --- src/content/guides/author-libraries.md | 28 ++++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/content/guides/author-libraries.md b/src/content/guides/author-libraries.md index a7e3439e9f39..b393e1f946f1 100644 --- a/src/content/guides/author-libraries.md +++ b/src/content/guides/author-libraries.md @@ -9,7 +9,7 @@ contributors: - marioacc --- -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.. +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. ## Authoring a Library @@ -80,15 +80,19 @@ export function wordToNum(word) { The usage specification for the library use will be as follows: ```javascript -import * as webpackNumbers from 'webpack-numbers'; //ES2015 module import -var webpackNumbers = require('webpack-numbers'); //CommonJS module require +// ES2015 module import +import * as webpackNumbers from 'webpack-numbers'; +// CommonJS module require +var webpackNumbers = require('webpack-numbers'); ... -webpackNumbers.wordToNum('Two') //ES2015 and CommonJS module use +// ES2015 and CommonJS module use +webpackNumbers.wordToNum('Two'); ... -//AMD module require +// AMD module require require(['webpackNumbers'], function ( webpackNumbers) { ... - webpackNumbers.wordToNum('Two')//AMD module use + // AMD module use + webpackNumbers.wordToNum('Two'); ... }); @@ -102,11 +106,11 @@ The consumer also can use the library loading it with the script tag: @@ -216,7 +220,8 @@ module.exports = { externals: [ 'library/A', 'library/B', - /^library\/.+$/ // everything that starts with "library/" + // everything that starts with "library/" + /^library\/.+$/ ] ... }; @@ -297,7 +302,8 @@ __package.json__ ```javascript { "main": "dist/webpack-numbers.js", - "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 + // To add as standard module as per https://github.com/dherman/defense-of-dot-js/blob/master/proposal.md#typical-usage + "module": "src/index.js", } ```