Skip to content

Commit

Permalink
Merge pull request #7803 from oygen87/patch-1
Browse files Browse the repository at this point in the history
Update example.js , newer syntax
  • Loading branch information
sokra committed Sep 25, 2018
2 parents 91e9dd7 + 6126ec7 commit 4ed8c08
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
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);
};
};

0 comments on commit 4ed8c08

Please sign in to comment.