3.1.0 • Published 8 months ago
babel-preset-moon v3.1.0
babel-preset-moon
A modern Babel preset with built-in TypeScript support. Is designed for unit testing, linting, and local development only -- it should not be used for web applications or package building (use Packemon instead).
yarn add --dev babel-preset-moonSetup
Add the preset to your root babel.config.js.
module.exports = {
  presets: ['moon'],
};Features
- Configures the envpreset for the current Node.js version.
- Enables the typescriptpreset by default. TypeScript everywhere!
- Enables native async/awaitand avoids Regenerator.
- Enables exportdefault and namespace from syntax.
- Supports the reactpreset and both JSX runtimes.
- Supports the solidpreset with SSR and hydration.
- Converts __DEV__,__PROD__, and__TEST__toprocess.envchecks.
- Wraps invariant()inprocess.envconditionals.
Options
The following options can be passed to the preset.
- decorators(- boolean) - Enable TypeScript decorators. If true, will toggle Babel into loose mode. Defaults to- false.
- loose(- boolean) - Turn on Babel loose mode for all plugins. Defaults to- false.
- modules(- boolean) - Force transpilation to use ECMA script module syntax. Defaults to- false(- automodules).
- react(- boolean | classic | automatic) - Enable the React plugin and the defined JSX runtime. Defaults to- false.
- solid(- boolean | ssr) - Enable the Solid.js plugin. Hydration is always enabled.
- targets(- Record<string, string> | string[] | string) - Override the target environment. Defaults to Node.js- current.
module.exports = {
  presets: [['moon', { decorators: true, react: 'automatic' }]],
};3.1.0
8 months ago
3.0.4
11 months ago
3.0.3
1 year ago
3.0.2
1 year ago
3.0.1
2 years ago
3.0.0
2 years ago
2.0.15
2 years ago
2.0.14
2 years ago
2.0.13
2 years ago
2.0.12
2 years ago
2.0.11
2 years ago
2.0.7
2 years ago
2.0.6
2 years ago
2.0.9
2 years ago
2.0.10
2 years ago
2.0.8
2 years ago
2.0.5
2 years ago
2.0.4
2 years ago
2.0.3
3 years ago
2.0.2
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.1.4
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.1.3
3 years ago
1.1.2
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
0.1.0
3 years ago
0.0.1
3 years ago