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

Add cli functionality (call out to babel cli and pass in the minify p… #49

Merged
merged 1 commit into from
Jul 19, 2016

Conversation

hzoo
Copy link
Member

@hzoo hzoo commented Jul 19, 2016

…reset)

We can change all the names here later to babili or whatever we decide in #8

Asked @gigabo on babel slack for help 😄

Also made the preset + cli a dependency (we probably don't want them as peer right)

@hzoo hzoo mentioned this pull request Jul 19, 2016
13 tasks
@amasad
Copy link
Member

amasad commented Jul 19, 2016

interesting -- so the cli just shells out to babel-cli?

@hzoo
Copy link
Member Author

hzoo commented Jul 19, 2016

Yeah, got it from #minify slack - spawn the babel-cli program with the same arguments given to babel-minify and also pass the env variables

$ ./bin/babel-minify.js src/index.js

"use strict";var _child_process=require("child_process"),_child_process2=_interopRequireDefault(_child_process);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var args=process.argv.slice(2).concat(["--presets=minify"]),opts={stdio:"inherit",env:process.env};_child_process2.default.spawn(require.resolve("babel-cli/bin/babel"),args,opts);

screen shot 2016-07-19 at 4 52 17 pm

@amasad
Copy link
Member

amasad commented Jul 19, 2016

great!

@amasad amasad merged commit 2f45d66 into master Jul 19, 2016
@amasad amasad deleted the add-cli branch July 19, 2016 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants