How to use the @babel/plugin-syntax-decorators.default function in @babel/plugin-syntax-decorators

To help you get started, we’ve selected a few @babel/plugin-syntax-decorators 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 ikatun / nnode / config.js View on Github external
require('./build/babel-preset-typescript').default
    ]);
  }

  presets.push([
    require('@babel/preset-env').default,
    {
      targets: {node: nodeVersion || 'current'}
    }
  ]);

  var plugins = [];

  if (language === 'ts') {
    require('reflect-metadata');
    plugins.push([require('@babel/plugin-syntax-decorators').default, {legacy: true}]);
    plugins.push([require('./build/typescript-babel-decorators.js').default]);
  }

  if (language === 'js') {
    plugins.push([require('@babel/plugin-proposal-decorators').default, { legacy: true }]);
  }

  plugins.push([require('@babel/plugin-proposal-class-properties').default, { loose: true }]);

  var enableLocalBabelRc = process.env.ENABLE_LOCAL_BABEL_RC;

  var configuration = {
    presets: presets,
    plugins: plugins,
    babelrc: !!enableLocalBabelRc,
    extensions: ['.es6', '.es', '.jsx', '.js', '.mjs', '.ts', '.tsx']

@babel/plugin-syntax-decorators

Allow parsing of decorators

MIT
Latest version published 1 month ago

Package Health Score

95 / 100
Full package analysis

Popular @babel/plugin-syntax-decorators functions