Socket
Socket
Sign inDemoInstall

babel-compile

Package Overview
Dependencies
60
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 2.0.0

.npmignore

29

lib/cli.js

@@ -17,19 +17,11 @@ #!/usr/bin/env node

var config = {};
function addConfig(cfg) {
var module;
var config = {
presets: [],
babelrc: false,
};
try {
module = require(cfg);
} catch (err) {
try {
module = require(path.join(process.cwd(), cfg));
} catch (err2) {
console.error('Configuration file or module cannot be resolved: ' + cfg);
process.exit(1);
}
}
console.log('Loading configuration from: ' + cfg);
_.merge(config, module);
function addConfig(preset) {
preset = 'babel-preset-' + preset;
console.log('Adding preset: ' + preset);
config.presets.push(preset);
}

@@ -39,5 +31,4 @@

.version(pkgjson.version)
.option('-c, --config-module [modulename]',
'node module which exports a bable configuration object.' +
' This value is require()\'d and used verbatim.', addConfig, [])
.option('-p, --preset [modulename]',
'Specifies which babel-preset to use', addConfig, [])
.parse(process.argv);

@@ -44,0 +35,0 @@

{
"name": "babel-compile",
"version": "1.0.2",
"version": "2.0.0",
"description": "A script to compile .js and .jsx to es6 with Babel using babel-core, that actually works!",
"main": "lib/compile.js",
"scripts": {
"test": "node ./lib/cli.js sample-in:sample-out"
"installTestPreset": "test ! -d ./node_modules/babel-preset-es2015 && npm install babel-preset-es2015 || true",
"test": "npm run installTestPreset && node ./lib/cli.js -p es2015 sample-in:sample-out"
},

@@ -24,9 +25,9 @@ "bin": {

"dependencies": {
"babel-core": "^6.7.0",
"commander": "^2.8.1",
"fs-walk": "0.0.1",
"lodash": "^3.10.1",
"lodash": "^4.11.1",
"mkdirp": "^0.5.1",
"rimraf": "^2.4.3",
"babel-core": "^6.0.0"
"rimraf": "^2.4.3"
}
}

@@ -16,6 +16,6 @@ # babel-compile

## Getting started
First, you're going to want to install this package and the taskcluster global configs
First, you're going to want to install this package
```
npm install babel-compile --save-dev
npm install taskcluster-configs --save-dev
npm install babel-preset-es2015 --save-dev
```

@@ -32,3 +32,3 @@ Next, you're going to want to add it to your `package.json` file's scripts

"scripts": {
"compile": "babel-compile -c taskcluster-lib-rules/babel src:lib test:.test",
"compile": "babel-compile -p es2015 src:lib test:.test",
"pretest": "npm run compile",

@@ -35,0 +35,0 @@ "prepublish": "npm run compile"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc