Skip to content

Commit

Permalink
🐠 Add babel-preset-accurapp! 🎊 fixes #22
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofugaro committed Mar 13, 2018
1 parent cf37f21 commit 07bee66
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/babel-preset-accurapp/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = function (context, opts = {}) {
const env = process.env.BABEL_ENV || process.env.NODE_ENV
const isDevelopment = env === 'development'

return {
presets: [
// Browsers are taken from the browserslist field in package.json
[require('@babel/preset-env').default, {
modules: false,
useBuiltIns: 'usage',
}],
[require('@babel/preset-react').default, {
// Adds component stack to warning messages
// Adds __self attribute to JSX which React will use for some warnings
development: isDevelopment,
}],
require('@babel/preset-stage-0').default,
],
plugins: [
require('babel-plugin-lodash'),
require('babel-plugin-macros'),
],
}
}
21 changes: 21 additions & 0 deletions packages/babel-preset-accurapp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "babel-preset-accurapp",
"version": "3.0.0",
"description": "Babel preset used by Accurat",
"repository": "accurat/accurapp",
"license": "MIT",
"engines": {
"node": ">=7"
},
"files": [
"index.js"
],
"dependencies": {
"@babel/core": "^7.0.0-beta.39",
"@babel/preset-env": "^7.0.0-beta.39",
"@babel/preset-react": "^7.0.0-beta.39",
"@babel/preset-stage-0": "^7.0.0-beta.39",
"babel-plugin-lodash": "^3.3.2",
"babel-plugin-macros": "^2.1.0"
}
}

0 comments on commit 07bee66

Please sign in to comment.