How to use the babel-plugin-macros.default function in babel-plugin-macros

To help you get started, weโ€™ve selected a few babel-plugin-macros examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commercetools / ui-kit / babel.config.js View on Github external
// behavior for any plugins that require one.
          useBuiltIns: true,
        },
      ],
      [
        '@emotion/babel-preset-css-prop',
        {
          sourceMap: isEnvDevelopment,
          autoLabel: !isEnvProduction,
        },
      ],
    ].filter(Boolean),
    plugins: [
      // Experimental macros support. Will be documented after it's had some time
      // in the wild.
      require('babel-plugin-macros').default,
      // export { default } from './foo'
      require('@babel/plugin-proposal-export-default-from').default,
      // export * from './foo'
      require('@babel/plugin-proposal-export-namespace-from').default,
      // Necessary to include regardless of the environment because
      // in practice some other transforms (such as object-rest-spread)
      // don't work without it: https://github.com/babel/babel/issues/7215
      require('@babel/plugin-transform-destructuring').default,
      // class { handleClick = () => { } }
      // Enable loose mode to use assignment instead of defineProperty
      // See discussion in https://github.com/facebook/create-react-app/issues/4263
      [
        require('@babel/plugin-proposal-class-properties').default,
        {
          loose: true,
        },

babel-plugin-macros

Allows you to build compile-time libraries

MIT
Latest version published 4 years ago

Package Health Score

79 / 100
Full package analysis