in each package that would normally have some babel preset, do
echo '{"presets": ["@nsfmc/babel-preset-sketching"]}' > .babelrc
and add this package to dependencies
module.exports = function(api, opts) { | |
const prod = process.env.NODE_ENV === "production"; | |
return { | |
presets: [ | |
[ | |
require("@babel/preset-env"), | |
{ | |
targets: { | |
browsers: [">1%", "not ie 11"] | |
} | |
} | |
], | |
require("@babel/preset-flow"), | |
require("@babel/preset-react") | |
], | |
plugins: [ | |
require("@babel/plugin-proposal-class-properties").default, | |
require("@babel/plugin-proposal-object-rest-spread").default, | |
require("@babel/plugin-proposal-numeric-separator").default, | |
require("@babel/plugin-transform-classes").default, | |
require("@babel/plugin-transform-destructuring").default, | |
prod && require("@babel/plugin-transform-react-constant-elements").default | |
].filter(Boolean) | |
}; | |
}; |
{ | |
"name": "@nsfmc/babel-preset-sketching", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"dependencies": { | |
"@babel/cli": "^7.0.0-beta.46", | |
"@babel/core": "^7.0.0-beta.46", | |
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.46", | |
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.46", | |
"@babel/plugin-proposal-numeric-separator": "^7.0.0-beta.46", | |
"@babel/plugin-transform-classes": "^7.0.0-beta.46", | |
"@babel/plugin-transform-destructuring": "^7.0.0-beta.46", | |
"@babel/plugin-transform-react-constant-elements": "^7.0.0-beta.46", | |
"@babel/preset-env": "^7.0.0-beta.46", | |
"@babel/preset-flow": "^7.0.0-beta.46", | |
"@babel/preset-react": "^7.0.0-beta.46" | |
} | |
} |