Skip to content

Commit bb51990

Browse files
author
Oskar Karlsson
committed
perf(compile): Precompile ES6 code
Precompiling all ES6 code to ES5 with babel to gain performance Adding a .nodeignore file as well to ignore the source code and tests files when publishing to npm See #39
1 parent d1a00d1 commit bb51990

File tree

7 files changed

+12
-13
lines changed

7 files changed

+12
-13
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules/
22
.tmp/
33
coverage/
44
artifacts/
5-
npm-debug.log
5+
/dist
6+
npm-debug.log

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/meta
2+
/src
3+
/test

bin/commitizen

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
#!/usr/bin/env node
22

3-
require("babel/register")({
4-
ignore: /node_modules\/(?!commitizen)/
5-
});
6-
require('./commitizen.js');
3+
require('./commitizen.js');

bin/commitizen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
require('../src/cli/commitizen.js').bootstrap();
2+
require('../dist/cli/commitizen.js').bootstrap();

bin/git-cz

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
#!/usr/bin/env node
22

3-
require("babel/register")({
4-
ignore: /node_modules\/(?!commitizen)/
5-
});
6-
require('./git-cz.js');
3+
require('./git-cz.js');

bin/git-cz.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
require("babel/register");
21
var path = require('path');
3-
require('../src/cli/git-cz.js').bootstrap({
2+
require('../dist/cli/git-cz.js').bootstrap({
43
cliPath: path.join(__dirname, '../')
5-
});
4+
});

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"scripts": {
77
"check-coverage": "istanbul check-coverage --statements 80 --branches 80 --functions 80 --lines 80 ",
88
"commit": "git-cz",
9+
"build": "babel src --out-dir dist",
10+
"prepublish": "npm run build",
911
"report-coverage": "cat ./coverage/lcov.info | codecov",
1012
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
1113
"start": "npm run test:watch",

0 commit comments

Comments
 (0)