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

To help you get started, we’ve selected a few babel-plugin-debug-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 glimmerjs / glimmer-vm / build / broccoli / build-packages.js View on Github external
'use strict';

const funnel = require('broccoli-funnel');
const babel = require('broccoli-babel-transpiler');
const merge = require('broccoli-merge-trees');
const Rollup = require('broccoli-rollup');
const sourcemaps = require('rollup-plugin-sourcemaps');
const UnwatchedDir = require('broccoli-source').UnwatchedDir;
const transpileToES5 = require('./transpile-to-es5');
const writePackageJSON = require('./write-package-json');
const writeLicense = require('./write-license');
const debugMacros = require('babel-plugin-debug-macros').default;

const Project = require('../utils/project');
const project = Project.from('packages');

module.exports = function buildPackages(es2017, matrix) {
  // Filter out test files from the package builds.
  es2017 = funnel(es2017, {
    exclude: ['**/test/**']
  });

  // Create an ES5 version of the higher-fidelity ES2017 code.
  let es5 = transpileToES5(es2017);
  let targets = { es5, es2017 };

  let packages = project.packages
    .map(buildPackage);
github glimmerjs / glimmer-vm / build / broccoli / transpile-to-es5.js View on Github external
'use strict';

const babel = require('broccoli-babel-transpiler');
const debugMacros = require('babel-plugin-debug-macros').default;

const PRODUCTION = process.env.EMBER_ENV === 'production';

/**
 * Transpiles a tree of ES2015+ JavaScript files to ES5 with Babel.
 */
module.exports = function transpileToES5(inputNode, modules = false) {
  let plugins = [
    // Required for tests to pass in IE <=10, which rely on inheritance of
    // static class methods. This doesn't work in IE 10 and below so we
    // statically copy properties off __proto__ at class definition time.
    'transform-proto-to-assign',
  ];

  if (!PRODUCTION) {
    // Compile out @glimmer/env for tests
github glimmerjs / glimmer-vm / build / broccoli / strip-glimmer-utilities.js View on Github external
'use strict';

const babel = require('broccoli-babel-transpiler');
const stripGlimmerUtils = require('babel-plugin-strip-glimmer-utils');
const debugMacros = require('babel-plugin-debug-macros').default;
const nuke = require('babel-plugin-nukable-import');
const nameResolver = require('amd-name-resolver').moduleResolve;

/**
 * Optimizes out Glimmer utility functions and strips debug code with a set of
 * Babel plugins.
 */
module.exports = function(jsTree) {
  let RETAIN_FLAGS = process.env.RETAIN_FLAGS;
  let glimmerUtils = [];

  console.log('retain flags', RETAIN_FLAGS);

  if (!RETAIN_FLAGS) {
    glimmerUtils.push([
      debugMacros,

babel-plugin-debug-macros

Debug macros and feature flag stripping

MIT
Latest version published 5 months ago

Package Health Score

73 / 100
Full package analysis

Popular babel-plugin-debug-macros functions