babel-preset-yoshi v4.78.0
babel-preset-yoshi
Yoshi provides its own preset for full-stack, client or Node.js projects. It is pre-configured, maintained and tuned for the current state of Yoshi.
Usages in Yoshi projects
Configure yoshi to use its built-in preset by adding the following to your package.json:
{
"babel": {
"presets": ["yoshi"]
}
}Configuration options
targets: Avoid redundant transformations if specified targets already support some of ESNext features. Read more. By default, if notargetsprovided, it will compile for all targets (nodeon test environment).modules(default:"commonjs"): Enable transformation of ES6 module syntax to another module type. Read more. Setfalseto ignore module transforms.ignoreReact(default:false): Ignores plugins and presets related to React.debug(default:false): Outputs the targets/plugins used according to specified targets. Read more.
Modes
The preset behaves differently according to the environment. The environment is determined by checking process.env.BABEL_ENV, process.env.NODE_ENV and use development as the default if none was supplied.
NODE_ENV = 'test'- Transpile for current node version for fast testing in mind.NODE_ENV = 'development'- Transpile for modern browsers for fast builds in mind.NODE_ENV = 'production'- Optimize bundle, compile for all possible targets fromIE10, prepare for uglifycation, with full browsers support, runtime optimization and small bundle size in mind.
Wanna know what's inside?
- preset-env for ESNext to ES5 transform. Moreover, you can customize current targets and module type to build for. Will use all targets and commonjs module type as a default values. Configured with target
nodefortestenvironment. - preset-react for JSX and Flow transforms.
- transform-runtime externalize references to helpers and builtins, automatically polyfilling your code without polluting globals.
- transform-class-properties.
- transform-decorators (legacy).
Environment specific plugins:
test
- transoform-dynamic-import - Babel plugin to transpile import() to a deferred require(), for node.
- babel-plugin-syntax-object-rest-spread Allow the syntax of Object
{ ...rest, ...spread }
development
- syntax-dynamic-import - Allow the syntax of dynamic imports since all transformations done by webpack.
- babel-plugin-syntax-object-rest-spread Allow the syntax of Object
{ ...rest, ...spread }
production
- syntax-dynamic-import - Allow the syntax of dynamic imports since all transformations done by webpack.
- remove-prop-types only for production builds.
- babel-plugin-transform-object-rest-spread - Transform Object
{ ...rest, ...spread }
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago