Borrowing files from babel-preset-es2015, with modifications.

This commit is contained in:
Ben Newman
2015-11-12 17:38:34 -05:00
parent b283e8d844
commit 8bc803050e
4 changed files with 120 additions and 0 deletions

18
LICENSE.txt Normal file
View File

@@ -0,0 +1,18 @@
========================================
Meteor is licensed under the MIT License
========================================
Copyright (C) 2011--2015 Meteor Development Group
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====================================================================
This license applies to all code in Meteor that is not an externally
maintained library. Externally maintained libraries have their own
licenses, included in the LICENSES directory.
====================================================================

35
README.md Normal file
View File

@@ -0,0 +1,35 @@
# babel-preset-meteor
> Babel preset for all Meteor plugins.
## Install
```sh
$ npm install --save-dev babel-preset-meteor
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"presets": ["meteor"]
}
```
### Via CLI
```sh
$ babel script.js --presets meteor
```
### Via Node API
```javascript
require("babel-core").transform("code", {
presets: ["meteor"]
});
```

31
index.js Normal file
View File

@@ -0,0 +1,31 @@
module.exports = {
plugins: [
require("babel-plugin-check-es2015-constants"),
require("babel-plugin-syntax-flow"),
require("babel-plugin-syntax-trailing-function-commas"),
require("babel-plugin-transform-es2015-arrow-functions"),
require("babel-plugin-transform-es2015-block-scoped-functions"),
require("babel-plugin-transform-es2015-block-scoping"),
require("babel-plugin-transform-es2015-classes"),
require("babel-plugin-transform-es2015-computed-properties"),
require("babel-plugin-transform-es2015-destructuring"),
require("babel-plugin-transform-es2015-for-of"),
require("babel-plugin-transform-es2015-function-name"),
require("babel-plugin-transform-es2015-literals"),
[require("babel-plugin-transform-es2015-modules-commonjs"), {
loose: true
}],
require("babel-plugin-transform-es2015-object-super"),
require("babel-plugin-transform-es2015-parameters"),
require("babel-plugin-transform-es2015-shorthand-properties"),
require("babel-plugin-transform-es2015-spread"),
require("babel-plugin-transform-es2015-sticky-regex"),
require("babel-plugin-transform-es2015-template-literals"),
require("babel-plugin-transform-es2015-typeof-symbol"),
require("babel-plugin-transform-es2015-unicode-regex"),
require("babel-plugin-transform-es3-member-expression-literals"),
require("babel-plugin-transform-es3-property-literals"),
require("babel-plugin-transform-flow-strip-types"),
require("babel-plugin-transform-regenerator"),
]
};

36
package.json Normal file
View File

@@ -0,0 +1,36 @@
{
"name": "babel-preset-meteor",
"version": "6.1.18",
"description": "Babel preset for ES2015+ features supported by Meteor",
"author": "Ben Newman <ben@meteor.com>",
"license": "MIT",
"repository": "https://github.com/meteor/babel-preset-meteor",
"main": "index.js",
"dependencies": {
"babel-plugin-check-es2015-constants": "^6.1.18",
"babel-plugin-syntax-flow": "^6.1.18",
"babel-plugin-syntax-trailing-function-commas": "^6.1.18",
"babel-plugin-transform-es2015-arrow-functions": "^6.1.18",
"babel-plugin-transform-es2015-block-scoped-functions": "^6.1.18",
"babel-plugin-transform-es2015-block-scoping": "^6.1.18",
"babel-plugin-transform-es2015-classes": "^6.1.18",
"babel-plugin-transform-es2015-computed-properties": "^6.1.18",
"babel-plugin-transform-es2015-destructuring": "^6.1.18",
"babel-plugin-transform-es2015-for-of": "^6.1.18",
"babel-plugin-transform-es2015-function-name": "^6.1.18",
"babel-plugin-transform-es2015-literals": "^6.1.18",
"babel-plugin-transform-es2015-modules-commonjs": "^6.1.18",
"babel-plugin-transform-es2015-object-super": "^6.1.18",
"babel-plugin-transform-es2015-parameters": "^6.1.18",
"babel-plugin-transform-es2015-shorthand-properties": "^6.1.18",
"babel-plugin-transform-es2015-spread": "^6.1.18",
"babel-plugin-transform-es2015-sticky-regex": "^6.1.18",
"babel-plugin-transform-es2015-template-literals": "^6.1.18",
"babel-plugin-transform-es2015-typeof-symbol": "^6.1.18",
"babel-plugin-transform-es2015-unicode-regex": "^6.1.18",
"babel-plugin-transform-es3-member-expression-literals": "^6.1.18",
"babel-plugin-transform-es3-property-literals": "^6.1.18",
"babel-plugin-transform-flow-strip-types": "^6.1.18",
"babel-plugin-transform-regenerator": "^6.1.18"
}
}