babel-plugin-module-resolver - Custom module resolver plugin for Babel

  •        80

A Babel plugin to add a new resolver for your modules when compiling your code using Babel. This plugin allows you to add new "root" directories that contain your modules. It also allows you to setup a custom alias for directories, specific files, or even other npm modules. This plugin can simplify the require/import paths in your project. For example, instead of using complex relative paths like ../../../../utils/my-utils, you can write utils/my-utils. It will allow you to work faster since you won't need to calculate how many levels of directory you have to go up before accessing the file.

https://github.com/tleunen/babel-plugin-module-resolver

Dependencies:

find-babel-config : ^1.1.0
glob : ^7.1.2
pkg-up : ^2.0.0
reselect : ^3.0.1
resolve : ^1.4.0

Tags
Implementation
License
Platform

   




Related Projects

babel-plugin-webpack-loaders - babel 6 plugin which allows to use webpack loaders

  •    Javascript

Since plugin was published, there were a lot of changes in testing software. Be sure in most(all) cases you DON'T need this plugin for testing. I highly recommend you to use jest for testing, and use moduleNameMapper (identity-obj-proxy, etc) to mock CSS-Modules and other webpack loaders. This Babel 6 plugin allows you to use webpack loaders in Babel. It's now easy to run universal apps on the server without additional build steps, to create libraries as usual with babel src --out-dir lib command, to run tests without mocking-prebuilding source code. It just replaces require - import statements with webpack loaders results. Take a look at this Babel build output diff to get the idea.

babel-plugin-dynamic-import-webpack - Babel plugin to transpile import() to require

  •    Javascript

Babel plugin to transpile import() to require.ensure, for Webpack.Note that Webpack 2 has gotten import() after this code was written.

babel-plugin-import - Modularly import plugin for babel.

  •    Javascript

Modular import plugin for babel, compatible with antd, antd-mobile, lodash, material-ui, and so on. Note : with style: true css source files are imported and optimizations can be done during compilation time. With style: "css", pre bundled css files are imported as they are.

babel-plugin-flow-react-proptypes - A babel plugin to generate React PropTypes definitions from Flow type declarations

  •    Javascript

A babel plugin to generate React PropTypes definitions from Flow type declarations. Starting in 14.0.0, we output ES6 import/export statements by default. The deadCode option (explained below) will cause it to use common.js modules instead.

babel-plugin-react-css-modules - Transforms styleName to className using compile time CSS module resolution

  •    Javascript

Transforms styleName to className using compile time CSS module resolution. In contrast to react-css-modules, babel-plugin-react-css-modules has a lot smaller performance overhead (0-10% vs +50%; see Performance) and a lot smaller size footprint (less than 2kb vs 17kb react-css-modules + lodash dependency).


rollup-plugin-babel - Seamless integration between Rollup and Babel

  •    Javascript

Seamless integration between Rollup and Babel.Both approaches have disadvantages – in the first case, on top of the additional configuration complexity, you may end up with Babel's helpers (like classCallCheck) repeated throughout your code (once for each module where the helpers are used). In the second case, transpiling is likely to be slower, because transpiling a large bundle is much more work for Babel than transpiling a set of small files.

babel-plugin-macros - 🎣 Enables zero-config, importable babel plugins

  •    Javascript

Check out this guest post on the Babel.js blog for a complete write up on the problem, motivation, and solution.Currently, each babel plugin in the babel ecosystem requires that you configure it individually. This is fine for things like language features, but can be frustrating overhead for libraries that allow for compile-time code transformation as an optimization.

babel-plugin-transform-decorators-legacy - A plugin for Babel 6 that (mostly) replicates the old decorator behavior from Babel 5

  •    Javascript

This is a plugin for Babel 6 that is meant to replicate the old decorator behavior from Babel 5 in order to allow people to more easily transition to Babel 6 without needing to be blocked on updates to the decorator proposal or for Babel to re-implement it. If you are including your plugins manually and using transform-class-properties, make sure that transform-decorators-legacy comes before transform-class-properties.

eslint-plugin-babel - An ESlint rule plugin companion to babel-eslint

  •    Javascript

An eslint plugin companion to babel-eslint. babel-eslint does a great job at adapting eslint for use with Babel, but it can't change the built in rules to support experimental features. eslint-plugin-babel re-implements problematic rules so they do not give false positives or negatives.Finally enable all the rules you would like to use (remember to disable the original ones as well!).

babel-loader - 📦 Webpack plugin for Babel

  •    Javascript

This package allows transpiling JavaScript files using Babel and webpack.Notes: Issues with the output should be reported on the babel issue tracker.

babel-plugin-preval - Pre-evaluate code at build-time

  •    Javascript

You need to do some dynamic stuff, but don't want to do it at runtime. Or maybe you want to do stuff like read the filesystem to get a list of files and you can't do that in the browser.There's also preval.require('./something') and import x from /* preval */ './something' (which can both take some arguments) or add // @preval comment at the top of a file.

react-inline - Transform inline styles defined in JavaScript modules into static CSS code and class names so they become available to, e

  •    Javascript

Note: Thanks to the new possibilities of Babel v6+, there's also my babel-plugin-css-in-js project, which works exactly the same but doesn't require a separate CLI/API. If you're using Babel for code transpilation, just put babel-plugin-css-in-js in your build pipeline. Transform inline styles defined in JavaScript modules into static CSS code and class names so they become available to, e.g. the className prop of React elements.

babel-plugin-css-in-js - A plugin for Babel v6 which transforms inline styles defined in JavaScript modules into class names so they become available to, e

  •    Javascript

A plugin for Babel v6 which transforms inline styles defined in JavaScript modules into class names so they become available to, e.g. the className prop of React elements. While transforming, the plugin processes all JavaScript style definitions found and bundles them up into a CSS file, ready to be requested from your web server. babel-plugin-css-in-js works seamlessly on both client and server. It has built-in support for media queries, pseudo-classes, attribute selectors, and theming. The plugin's options allow you to configure vendor-prefixing, minification, and class name compression.

es6-module-transpiler - Tomorrow’s JavaScript module syntax today

  •    Javascript

This project is part of esnext, which has merged with Babel. All the features of esnext are supported by Babel, and more. All the tests from esnext have been ported over to Babel to ensure that switchers will have minimal code changes to make. The maintainers of esnext will continue working on Babel to bring better spec compliance, ES6 feature support, and performance. If you want a fast tool with bundling support as found in this project, you should check out Rollup. ES6 Module Transpiler is an experimental compiler that allows you to write your JavaScript using a subset of the ES6 module syntax, and compile it into AMD or CommonJS modules.

react-css-modules - Seamless mapping of class names to CSS modules inside of React components.

  •    Javascript

If you are considering to use react-css-modules, evaluate if babel-plugin-react-css-modules covers your use case. babel-plugin-react-css-modules is a lightweight alternative of react-css-modules. babel-plugin-react-css-modules is not a drop-in replacement and does not cover all the use cases of react-css-modules. However, it has a lot smaller performance overhead (0-10% vs +50%; see Performance) and a lot smaller size footprint (less than 2kb vs +17kb).

babel-plugin-react-intl - Extracts string messages from React components that use React Intl.

  •    Javascript

Extracts string messages for translation from modules that use React Intl.Note: This Babel plugin works with React Intl v2.x, and 1.x of this plugin works with Babel 5, 2.x works with Babel 6.

babel-plugin-tcomb - Babel plugin for static and runtime type checking using Flow and tcomb

  •    Javascript

Babel plugin for static and runtime type checking using Flow and tcomb. Flow is a static type checker for JavaScript.

babel-minify-webpack-plugin - Babel Minify Webpack Plugin

  •    Javascript

minifyOpts are passed on to babel-preset-minify. You can find a list of all available options in the package directory.