mimosa-babel
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -6,3 +6,3 @@ "use strict"; | ||
return { | ||
to5: { | ||
babel: { | ||
// File extensions | ||
@@ -17,16 +17,16 @@ extensions: ["js", "es6"], | ||
// List of transformers to EXCLUDE. | ||
// Run `6to5 --help` to see a full list of transformers. | ||
// Run `babel --help` to see a full list of transformers. | ||
blacklist: [], | ||
// List of transformers to ONLY use. | ||
// Run `6to5 --help` to see a full list of transformers. | ||
// Run `babel --help` to see a full list of transformers. | ||
whitelist: [], | ||
// Module formatter to use | ||
// Run `6to5 --help` to see a full list of module formatters. | ||
// Default: "common" | ||
// Run `babel --help` to see a full list of module formatters. | ||
// Default: 'common' | ||
modules: "common", | ||
// If truthy, adds a `map` property to returned output. | ||
// If set to "inline", a comment with a sourceMappingURL directive is added to | ||
// If set to 'inline', a comment with a sourceMappingURL directive is added to | ||
// the bottom of the returned code. | ||
@@ -69,3 +69,3 @@ // Default: true | ||
// Indent string | ||
// Default: " " | ||
// Default: ' ' | ||
style: " ", | ||
@@ -86,16 +86,16 @@ | ||
if (validators.ifExistsIsObject(errors, "to5 config", config.to5)) { | ||
if (validators.isArrayOfStringsMustExist(errors, "to5.extensions", config.to5.extensions)) { | ||
if (config.to5.extensions.length === 0) { | ||
errors.push("to5.extensions cannot be an empty array"); | ||
if (validators.ifExistsIsObject(errors, "babel config", config.babel)) { | ||
if (validators.isArrayOfStringsMustExist(errors, "babel.extensions", config.babel.extensions)) { | ||
if (config.babel.extensions.length === 0) { | ||
errors.push("babel.extensions cannot be an empty array"); | ||
} | ||
} | ||
validators.ifExistsIsObject(errors, "to5.options", config.to5.options); | ||
validators.ifExistsIsArray(errors, "to5.exclude", config.to5.exclude); | ||
validators.ifExistsIsObject(errors, "babel.options", config.babel.options); | ||
validators.ifExistsIsArray(errors, "babel.exclude", config.babel.exclude); | ||
} | ||
// if user has not provided their own version, use local 6to5 | ||
if (!errors.length && !config.to5.lib) { | ||
config.to5.lib = require("6to5"); | ||
// if user has not provided their own version, use local babel | ||
if (!errors.length && !config.babel.lib) { | ||
config.babel.lib = require("babel"); | ||
} | ||
@@ -102,0 +102,0 @@ |
@@ -11,3 +11,3 @@ "use strict"; | ||
exports.validate = _config.validate; | ||
var name = exports.name = "6to5"; | ||
var name = exports.name = "babel"; | ||
var compilerType = exports.compilerType = "javascript"; | ||
@@ -14,0 +14,0 @@ Object.defineProperty(exports, "__esModule", { |
@@ -13,3 +13,3 @@ "use strict"; | ||
if (isExcluded(config.exclude, file.inputFileName)) { | ||
logger.debug("skipping 6to5 transpiling for [[ " + file.inputFileName + " ]], file is excluded"); | ||
logger.debug("skipping babel transpiling for [[ " + file.inputFileName + " ]], file is excluded"); | ||
return cb(); | ||
@@ -19,4 +19,4 @@ } | ||
if (file.isVendor) { | ||
logger.debug("skipping 6to5 transpiling for [[ " + file.inputFileName + " ]], is vendor file"); | ||
//console.log "skipping 6to5 transpiling for [[ #{file.inputFileName} ]], is vendor file" | ||
logger.debug("skipping babel transpiling for [[ " + file.inputFileName + " ]], is vendor file"); | ||
//console.log "skipping babel transpiling for [[ #{file.inputFileName} ]], is vendor file" | ||
return cb(); | ||
@@ -92,3 +92,3 @@ } | ||
function extensions(conf) { | ||
return conf.to5.extensions; | ||
return conf.babel.extensions; | ||
} | ||
@@ -98,3 +98,3 @@ | ||
logger = conf.log; | ||
return _compile(conf.to5, file, cb); | ||
return _compile(conf.babel, file, cb); | ||
} | ||
@@ -101,0 +101,0 @@ Object.defineProperty(exports, "__esModule", { |
{ | ||
"name": "mimosa-babel", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "babel mimosa files", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index", |
@@ -1,5 +0,5 @@ | ||
mimosa-6to5 | ||
mimosa-babel | ||
=========== | ||
This is a [6to5](https://6to5.org/) compiler module for the Mimosa build tool. It will compile your ES6 JavaScript to ES5 JavaScript. | ||
This is a [babel](https://babeljs.org/) compiler module for the Mimosa build tool. It will compile your ES6 JavaScript to ES5 JavaScript. | ||
@@ -10,7 +10,7 @@ For more information regarding Mimosa, see http://mimosa.io | ||
Add `'6to5'` to your list of modules. That's all! Mimosa will install the module for you when you start `mimosa watch` or `mimosa build`. | ||
Add `'babel'` to your list of modules. That's all! Mimosa will install the module for you when you start `mimosa watch` or `mimosa build`. | ||
## Functionality | ||
This module will process your `.js` files and compile them using [6to5](https://6to5.org/). This module will not compile vendor JavaScript files. | ||
This module will process your `.js` files and compile them using [babel](https://babeljs.org/). This module will not compile vendor JavaScript files. | ||
@@ -20,3 +20,3 @@ ## Default Config | ||
```javascript | ||
to5: { | ||
babel: { | ||
extensions: ['js', 'es6'], | ||
@@ -48,3 +48,3 @@ exclude: [], | ||
#### `lib` node module | ||
You may want to use this module but may not want to use the version of 6to5 that comes bundled. Using the `lib` property you can provide a specific version of 6to5 if the one being used by this module isn't to your liking. To provide a specific version, you must have it npm installed into your project and then provide it to `lib`. For instance: `lib: require('6to5')`. | ||
You may want to use this module but may not want to use the version of babel that comes bundled. Using the `lib` property you can provide a specific version of babel if the one being used by this module isn't to your liking. To provide a specific version, you must have it npm installed into your project and then provide it to `lib`. For instance: `lib: require('babel')`. | ||
@@ -55,2 +55,2 @@ #### `extensions` array of strings | ||
#### `options` object | ||
This is a pass through to the 6to5 options object. For more details on how to configure 6to5, [check out the documentation](https://6to5.org/docs/usage/options/). | ||
This is a pass through to the babel options object. For more details on how to configure babel, [check out the documentation](https://babeljs.org/docs/usage/options/). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21463