@jackwilsdon/craco-use-babelrc

    1.0.0 • Public • Published

    craco-use-babelrc

    A craco plugin that enables .babelrc in create-react-app 2.

    Why?

    You might think you could just do this to enable .babelrc support;

    // craco.config.js
    
    module.exports = {
      babel: {
        loaderOptions: {
          babelrc: true,
        },
      },
    };

    However this actually still leaves the react-app babel preset enabled! If you're fine with this then you don't need this plugin and can just enable .babelrc using the configuration above.

    This plugin also clears the preset list for the loader.

    Installation

    Make sure you have craco installed before continuing. You can find the official installation instructions here.

    You can then install craco-use-babelrc using your package manager of choice;

    npm install --save @jackwilsdon/craco-use-babelrc
    yarn add @jackwilsdon/craco-use-babelrc

    Usage

    Simply enable the plugin in your craco.config.js, there's nothing to configure!

    // craco.config.js
    const BabelRcPlugin = require('@jackwilsdon/craco-use-babelrc');
    
    module.exports = {
      plugins: [
        { plugin: BabelRcPlugin },
      ],
    };

    Install

    npm i @jackwilsdon/craco-use-babelrc

    DownloadsWeekly Downloads

    1,384

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.79 kB

    Total Files

    4

    Last publish

    Collaborators

    • jackwilsdon