All Projects â†’ developit â†’ Modify Babel Preset

developit / Modify Babel Preset

💫 Create a modified babel preset based on an an existing preset.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Modify Babel Preset

Postjss
Use the power of PostCSS in compiling with JSS
Stars: ✭ 40 (-52.94%)
Mutual labels:  babel, babel-plugin
Babel Plugin Optimize Clsx
Babel plugin to optimize the use of clsx, classnames, and other libraries with a compatible API
Stars: ✭ 80 (-5.88%)
Mutual labels:  babel, babel-plugin
Xwasm
[Work In Progress] WebAssembly Packager and WASM tooling for modern frontend
Stars: ✭ 45 (-47.06%)
Mutual labels:  babel, babel-plugin
Htm
Hyperscript Tagged Markup: JSX alternative using standard tagged templates, with compiler support.
Stars: ✭ 7,299 (+8487.06%)
Mutual labels:  babel, babel-plugin
Sowing Machine
🌱A React UI toolchain & JSX alternative
Stars: ✭ 64 (-24.71%)
Mutual labels:  babel, babel-plugin
Babel Plugin Transform React Remove Prop Types
Remove unnecessary React propTypes from the production build. 🎈
Stars: ✭ 890 (+947.06%)
Mutual labels:  babel, babel-plugin
Babel Plugin Css Prop
Babel plugin to transpile `css` prop to a styled component. (Experimental)
Stars: ✭ 56 (-34.12%)
Mutual labels:  babel, babel-plugin
Babel Plugin React Remove Properties
Babel plugin for removing React properties. 💨
Stars: ✭ 327 (+284.71%)
Mutual labels:  babel, babel-plugin
Babel Plugin Captains Log
Babel plugin that injects helpful details into console statements
Stars: ✭ 80 (-5.88%)
Mutual labels:  babel, babel-plugin
Babel Plugin Partial Application
[DEPRECATED] Please use https://github.com/citycide/param.macro
Stars: ✭ 60 (-29.41%)
Mutual labels:  babel, babel-plugin
Babel Plugin Sitrep
Log all assignments and the return value of a function with a simple comment
Stars: ✭ 442 (+420%)
Mutual labels:  babel, babel-plugin
Catom
A 0 runtime CSS in JS library
Stars: ✭ 84 (-1.18%)
Mutual labels:  babel, babel-plugin
Faster.js
faster.js is a Babel plugin that compiles idiomatic Javascript to faster, micro-optimized Javascript.
Stars: ✭ 429 (+404.71%)
Mutual labels:  babel, babel-plugin
Babel Plugin Styled Components
Improve the debugging experience and add server-side rendering support to styled-components
Stars: ✭ 878 (+932.94%)
Mutual labels:  babel, babel-plugin
I18nize React
Internationalize react apps within a lunch break
Stars: ✭ 389 (+357.65%)
Mutual labels:  babel, babel-plugin
Babel Plugin Root Import
Add the opportunity to import modules by the root path
Stars: ✭ 1,084 (+1175.29%)
Mutual labels:  babel, babel-plugin
Babel Plugin Css Modules Transform
Extract css class names from required css module files, so we can render it on server.
Stars: ✭ 318 (+274.12%)
Mutual labels:  babel, babel-plugin
Babel Plugin Tailwind Components
Use Tailwind with any CSS-in-JS library
Stars: ✭ 320 (+276.47%)
Mutual labels:  babel, babel-plugin
Tinker.macro
Evaluate Laravel code at build-time, via Laravel Tinker
Stars: ✭ 56 (-34.12%)
Mutual labels:  babel, babel-plugin
Astexplorer.app
https://astexplorer.net with ES Modules support and Hot Reloading
Stars: ✭ 65 (-23.53%)
Mutual labels:  babel, babel-plugin

modify-babel-preset

npm npm travis

Create a modified babel preset based on an an existing preset.

Works best with npm 3.

npm i -S modify-babel-preset

API

A single function that takes an existing preset name and a mapping of plugin modifications to apply to that preset. Make sure you have the preset and any added plugins installed as dependencies.

newPreset = modifyBabelPreset(
	'existing-preset-name',
	{
		'plugin-name': false,  // remove
		'other-plugin': true,  // add
		'foo': { loose:true }  // add + config
	}
);

Modification keys are babel plugin names (you can exclude the babel-plugin- prefix).

Add/Update Plugins

To add a plugin, pass true, or a configuration object:

{
	// just add a plugin without config:
	'plugin-name': true,

	// add a plugin and set its config
	'other-plugin': { loose:true }
}

Note: adding a plugin that is already provided by the preset just overwrites its configuration.

Remove Plugins

To remove a plugin, pass false:

{
	'plugin-name': false
}

Example

Here's a simple preset. Just this index.js and a package.json pointing to it with the preset and plugin installed as dependencies.

var modifyBabelPreset = require('modify-babel-preset');

// just export the cloned, modified preset config:
module.exports = modifyBabelPreset('es2015', {

	// remove the typeof x==='symbol' transform:
	'transform-es2015-typeof-symbol': false,

	// add the JSX transform:
	'transform-react-jsx': true

});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].