Skip to content

Commit 319274c

Browse files
committed
add: example and configuration of babel
1 parent 532f834 commit 319274c

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"build": "babel src -d dist --presets es2015",
8-
"watch": "babel src -d dist --presets es2015 -w"
7+
"build": "babel src -d dist",
8+
"watch": "babel src -d dist -w"
9+
},
10+
"babel": {
11+
"presets": ["es2015"],
12+
"plugins": [],
13+
"minified": true,
14+
"ignore": "*test.js"
915
},
1016
"repository": {
1117
"type": "git",

src/babel.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
let text = "Some text";
1+
class SomeClass {
2+
constructor(someOptions) {
3+
this.prop1 = someOptions.prop1;
4+
this.prop2 = someOptions.prop2;
5+
this.prop3 = someOptions.prop3;
6+
}
7+
8+
someFunc() {
9+
console.log("This is some func of some class");
10+
}
11+
}

src/file-test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function createSomeCalcFunction(x) {
2+
return function() {
3+
console.log(1 + x);
4+
}
5+
}
6+
7+
const someFunc = createSomeCalcFunction(1);
8+
someFunc();

0 commit comments

Comments
 (0)