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

Can commitizen be pre-compiled? #39

Closed
jimthedev opened this issue Oct 23, 2015 · 3 comments
Closed

Can commitizen be pre-compiled? #39

jimthedev opened this issue Oct 23, 2015 · 3 comments

Comments

@jimthedev
Copy link
Member

Right now we're using babel/register to run everything in commitizen and to get ES6 features. I'm doing this because I need to be able to require() adapters on the fly but still get the features of ES6. I'd love for most of the cli to be pre-built with babel, leaving only the adapter part to using babel/register. This would help git-cz to be faster. I've never done this before and am not even sure if it is possible. Any help would be great.

@tjoskar
Copy link
Contributor

tjoskar commented Oct 28, 2015

One can add:

"scripts": {
    "prepublish": "node node_modules/babel/bin/babel.js src --out-dir dist"
}

And then create a .npmignore file to ignore the source files to be publish:

/src

And point the main file in package.json to the dist folder:

"main": "dist/index.js"

I think that would do the trick.

I can create a pull request if you want.

@jimthedev
Copy link
Member Author

If you want to put in a PR, that'd be excellent. My main concern is that we do a lot of work with paths and I'd just need to find a way to test the built version. Thanks so much!

tjoskar pushed a commit to tjoskar/cz-cli that referenced this issue Oct 30, 2015
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 commitizen#39
@jimthedev
Copy link
Member Author

Closed by #53. Thanks @tjoskar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants