Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example.js , newer syntax #7803

Merged
merged 3 commits into from Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/commonjs/README.md
Expand Up @@ -9,15 +9,15 @@ You can also see the info messages webpack prints to console (for both normal an
# example.js

``` javascript
var inc = require('./increment').increment;
var a = 1;
const inc = require('./increment').increment;
const a = 1;
inc(a); // 2
```

# increment.js

``` javascript
var add = require('./math').add;
const add = require('./math').add;
exports.increment = function(val) {
return add(val, 1);
};
Expand All @@ -27,7 +27,7 @@ exports.increment = function(val) {

``` javascript
exports.add = function() {
var sum = 0, i = 0, args = arguments, l = args.length;
let sum = 0, i = 0, args = arguments, l = args.length;
while (i < l) {
sum += args[i++];
}
Expand Down Expand Up @@ -197,4 +197,4 @@ chunk {0} output.js (main) 329 bytes [entry] [rendered]
cjs require ./increment [2] ./example.js 1:10-32
[2] ./example.js 69 bytes {0} [built]
single entry .\example.js main
```
```
6 changes: 3 additions & 3 deletions examples/commonjs/example.js
@@ -1,3 +1,3 @@
var inc = require('./increment').increment;
var a = 1;
inc(a); // 2
const inc = require('./increment').increment;
const a = 1;
inc(a); // 2
4 changes: 2 additions & 2 deletions examples/commonjs/increment.js
@@ -1,4 +1,4 @@
var add = require('./math').add;
const add = require('./math').add;
exports.increment = function(val) {
return add(val, 1);
};
};