Doesn't work with Babel 6 compiler // alias camel case for those who prefer it alias_properties_with_camel_case(webpack_isomorphic_tools.prototype)
355103
function construct_guesses(parts)
{
	if (parts.length === 1)
	{
		return [parts]
	}

	const last = parts.pop()
	const rest = construct_guesses(parts)

	const guesses = []

	for (const guess of rest)
	{
		const one = clone(guess)
		one.push('/~/')
		one.push(last)

		const two = clone(guess)
		two.push('/node_modules/')
		two.push(last)

		guesses.push(one)
		guesses.push(two)
	}

	return guesses
}
530846
function compileBundle(_ref) {
  var customWebConfig = _ref.customWebConfig,
      architecture = _ref.architecture;

  var workingDir = _tmp.default.dirSync().name;

  _winston.default.info('Compiling application bundle'); // Generate Meteor build


  _winston.default.debug('generate meteor build');

  _shelljs.default.exec(`meteor build ${workingDir} --directory --server-only --architecture os.windows.x86_${architecture}`); // Add custom web config


  if (customWebConfig !== undefined) {
    _winston.default.debug('add custom web config');

    try {
      _shelljs.default.cp(customWebConfig, _path.default.join(workingDir, 'bundle', 'web.config'));
    } catch (error) {
      throw new Error(`Could not read web config file at '${customWebConfig}'`);
    }
  } else {
    _winston.default.warn('Using default web config');
  } // Cleanup broken symlinks


  _winston.default.debug('checking for broken symlinks');

  _shelljs.default.find(_path.default.join(workingDir, 'bundle')).forEach(function (symlinkPath) {
    // Matches symlinks that do not exist
    if (_shelljs.default.test('-L', symlinkPath) && !_shelljs.default.test('-e', symlinkPath)) {
      // Delete file
      _shelljs.default.rm('-f', symlinkPath);

      _winston.default.debug(`deleted symlink at '${symlinkPath}'`);
    }
  }); // Create tarball


  _winston.default.debug('create tarball');

  var tarballPath = _path.default.join(workingDir, 'bundle.tar.gz');

  _tar.default.c({
    file: tarballPath,
    sync: true,
    follow: true,
    gzip: true,
    cwd: workingDir
  }, ['bundle']);

  return tarballPath;
}
467567
function ( pkg, compiler ) {
			if ( !sys.isEmpty( task.data.depends ) && options.resolveAliases && !sys.isEmpty( pkg.dependAliases ) ) {

				compiler.transform( function ( file ) {
					grunt.verbose.writeln( "Transforming " + file );
					function write( buf ) {
						data += buf;
					}

					var data = '';

					return through( write, function () {
						var __aliases = [];
						sys.each( pkg.dependAliases, function ( al ) {
							if ( data.indexOf( "'" + al + "'" ) !== -1 || data.indexOf( '"' + al + '"' ) !== -1 ) {
								__aliases.push( "'" + al + "' : '" + al + "'" );

								data = data.replace( new RegExp( "'" + al + "'", "g" ), "__aliases['" + al + "']" );
								data = data.replace( new RegExp( '"' + al + '"', "g" ), "__aliases['" + al + "']" );
							}
						} );
						if ( !sys.isEmpty( __aliases ) ) {
							var aliasDefinition = "var __aliases = {" + __aliases.join( ",\n" ) + "};\n";

							data = aliasDefinition + data;

						}
						this.queue( data );
						this.queue( null );
					} );

				} );
			}
		}
655752
function(alias, typeName){
    let template = this.resolve(typeName);
    if (!template){
      throw new ReferenceError('bad alias \'' + alias + '\': type \'' + typeName + '\' is undefined');
    }
    this.names[alias] = template;
  }
806855
function compile(config) {
    let compiler;
    try {
        compiler = webpack(config);
    }
    catch (error) {
        console.error('Failed to compile.', error);
        process.exitCode = 1;
    }
    return compiler;
}
43561
function(path, state) {
  var defaultReexportSpecifier = path.get('specifiers')[0];
  var local = defaultReexportSpecifier.get('local').get('name').node;
  var exported = defaultReexportSpecifier.get('exported').get('name').node;

  if (local !== 'default') {
    throw path.buildCodeFrameError('Only named exports allowed are reexports in index.js');
  }

  // used by Program's exit visitor
  state.set('reexports', true);

  path.replaceWith(
    buildExportsAssignment(
      t.callExpression(
        t.identifier('require'),
        [t.stringLiteral(path.node.source.value)]
      ),
      exported
    )
  );
}
752295
async function compileModel (projectPath, model) {
  await copyExternalScripts(projectPath, model)
  deInlineScripts(projectPath, model)

  const lookup = resolveScriptPaths(projectPath, model)

  let imports = ''
  for (let moduleName in lookup) {
    let p = path.isAbsolute(lookup[moduleName]) ? lookup[moduleName] : `./${path.normalize(lookup[moduleName])}`
    imports += `import ${moduleName} from '${p}'\n`
  }

  const pre = JSON.stringify(model, null, 2)

  let post = pre
  for (let moduleName in lookup)
    post = replaceAll(post, moduleName)

  return `import substrate from 'substrate'

// imports generated by the compiler
${imports}

const dom = document.createElement('div')
dom.id = 'myapp'
document.body.appendChild(dom)

const model = ${post}

const app = substrate({ dom, node: model.rootNode, registry: model.registry })`
}
422581
function compile(config) {
  return new Promise((resolve, reject) => {
    let compiler;
    try {
      compiler = webpack(config);
    } catch (e) {
      console.log('compile errors:', [e]); // eslint-disable-line
      reject(e);
      process.exit(1);
    }
    compiler.run((err, stats) => {
      err ? reject(err) : resolve(stats);
    });
  });
}
1105753
function doc(pkgName, pkgVersion) {
    const typedoc = require("typedoc");
    const typescriptOptions = require(path.resolve("./build/tsconfig.es5-commonjs.json")).compilerOptions;
    const typedocOptions = require(path.resolve("./build/typedoc.js"));

    // Add version number to header of generated HTML documentation
    typedocOptions.name = pkgName + " v" + pkgVersion;

    const app = new typedoc.Application(Object.assign(typedocOptions, typescriptOptions));

    // A path to source files can only be specified on the command line, 
    // in the API we have to specify individual source files.
    // Note that the "exclude" option pattern is also not considered in API code.
    const srcFiles = [];
    getTypedocModuleSources(path.resolve(typedocOptions.src), srcFiles);
    getTypedocModuleSources(path.resolve(typedocOptions.src, "db/adapters/"), srcFiles);

    rimraf.sync(path.resolve("./" + typedocOptions.out));

    logInfo("Generate HTML documentation from source code...");
    const success = app.generateDocs(srcFiles, typedocOptions.out);
    if (!success) {
        logError("Failed to generate HTML documentation");
    }

    function getTypedocModuleSources(srcPath, srcFiles) {
        fse.readdirSync(srcPath).forEach((file, index) => {
            let filePath = path.join(srcPath, file);
            if (!fse.lstatSync(filePath).isDirectory()) {
                if (path.extname(filePath) === ".ts") {
                    srcFiles.push(filePath);
                }
            }
        });
    }
}
371414
function transpile() {
        return rollup.rollup({
            entry: path.join(dirs.source, files.main)
        }).then(function (bundle) {
            return bundle.write({
                // output format - 'amd', 'cjs', 'es6', 'iife', 'umd'
                format: 'umd',
                dest: path.join(dirs.build, files.main),
                sourceMap: false,
                banner: grunt.config('banner'),
                intro: 'mx.version = \'' + grunt.config('pkg').version + '\';\n',
                footer: '\n',
                moduleName: 'mx'
            });
        });
    }
1070466
function compile(config) {
  let compiler;
  try {
    compiler = webpack(config);
  } catch (e) {
    printErrors('Failed to compile.', [e]);
    process.exit(1);
  }
  return compiler;
}
1368944
function es3 ({ remove, sourceMap, sourcemap } = {}) {
  const removeHash = {
    'defineProperty': [/^\s*Object\.defineProperty\(\s*exports,\s*'__esModule'.*\n$/mg, ''],
    'freeze': [/Object.freeze\s*\(\s*([^)]*)\)/g, '$1']
  }
  if (!Array.isArray(remove)) remove = Object.keys(removeHash)

  return {
    name: 'es3',
    transformBundle: function (code) {
      const magicString = new MagicString(code);
      for (let k in removeHash) {
        if (remove.indexOf(k) > -1) {
          const [pattern, value = ''] = removeHash[k];
          let match, start, end, replacement;

          while ((match = pattern.exec(code))) {
            start       = match.index;
            end         = start + match[0].length;
            replacement = value.toString();
            for (let i = 1; i < match.length; i++) {
              replacement = replacement.replace(`$${i}`, match[i]);
            }
            magicString.overwrite(start, end, replacement);
          }
        }
      }
      return {
        code: magicString.toString(),
        map:  (sourceMap !== false && sourcemap !== false) ?
          magicString.generateMap({ hires: true }) : { mappings: '' }
      }
    }
  }
}
64081
function buildExampleScripts(dev) {

  var dest = EXAMPLE_DIST_PATH;

  var opts = dev ? watchify.args : {};
  opts.debug = dev ? true : false;
  opts.hasExports = true;

  return function() {

    var common = browserify(opts),
      bundle = browserify(opts).require('./' + SRC_PATH + '/' + PACKAGE_FILE, { expose: PACKAGE_NAME }),
      example = browserify(opts).exclude(PACKAGE_NAME).add('./' + EXAMPLE_SRC_PATH + '/' + EXAMPLE_APP);

    DEPENDENCIES.forEach(function(pkg) {
      common.require(pkg);
      bundle.exclude(pkg);
      example.exclude(pkg);
    });

    if (dev) {
      watchBundle(common, 'common.js', dest);
      watchBundle(bundle, 'bundle.js', dest);
      watchBundle(example, 'app.js', dest);
    }

    return merge(
      doBundle(common, 'common.js', dest),
      doBundle(bundle, 'bundle.js', dest),
      doBundle(example, 'app.js', dest)
    );

  }

}
200331
function normalizeOptions(config) {
  var alias = config.alias || "foreign";
  var type = config.type;

  //
  if ((0, _typeof3.default)(config.options) !== "object" || Array.isArray(config.options)) {
    throw new TypeError("Invalid options type for " + alias);
  }

  //
  var options = (0, _assign2.default)({}, config.options);

  if (type !== "arguments") {
    if (options.filename !== undefined) {
      throw new Error(alias + ".filename is only allowed as a root argument");
    }

    if (options.babelrc !== undefined) {
      throw new Error(alias + ".babelrc is only allowed as a root argument");
    }
  }

  if (type === "preset") {
    if (options.only !== undefined) {
      throw new Error(alias + ".only is not supported in a preset");
    }
    if (options.ignore !== undefined) {
      throw new Error(alias + ".ignore is not supported in a preset");
    }
    if (options.extends !== undefined) {
      throw new Error(alias + ".extends is not supported in a preset");
    }
    if (options.env !== undefined) {
      throw new Error(alias + ".env is not supported in a preset");
    }
  }

  if (options.sourceMap !== undefined) {
    if (options.sourceMaps !== undefined) {
      throw new Error("Both " + alias + ".sourceMap and .sourceMaps have been set");
    }

    options.sourceMaps = options.sourceMap;
    delete options.sourceMap;
  }

  for (var key in options) {
    // check for an unknown option
    if (!optionNames.has(key)) {
      if (_removed2.default[key]) {
        throw new ReferenceError("Using removed Babel 5 option: " + alias + "." + key + " - " + _removed2.default[key].message);
      } else {
        // eslint-disable-next-line max-len
        var unknownOptErr = "Unknown option: " + alias + "." + key + ". Check out http://babeljs.io/docs/usage/options/ for more information about options.";

        throw new ReferenceError(unknownOptErr);
      }
    }
  }

  if (options.parserOpts && typeof options.parserOpts.parser === "string") {
    options.parserOpts = (0, _assign2.default)({}, options.parserOpts);
    options.parserOpts.parser = (0, _files.loadParser)(options.parserOpts.parser, config.dirname).value;
  }

  if (options.generatorOpts && typeof options.generatorOpts.generator === "string") {
    options.generatorOpts = (0, _assign2.default)({}, options.generatorOpts);
    options.generatorOpts.generator = (0, _files.loadGenerator)(options.generatorOpts.generator, config.dirname).value;
  }

  delete options.passPerPreset;
  delete options.plugins;
  delete options.presets;

  return options;
}
442658
function finalizeCompile() {
  if (fs.existsSync(path.join(__dirname, './lib'))) {
    // Build package.json version to lib/version/index.js
    // prevent json-loader needing in user-side
    const versionFilePath = path.join(process.cwd(), 'lib', 'version', 'index.js');
    const versionFileContent = fs.readFileSync(versionFilePath).toString();
    fs.writeFileSync(
      versionFilePath,
      versionFileContent.replace(
        /require\(('|")\.\.\/\.\.\/package\.json('|")\)/,
        `{ version: '${packageInfo.version}' }`,
      ),
    );
    // eslint-disable-next-line
    console.log('Wrote version into lib/version/index.js');

    // Build package.json version to lib/version/index.d.ts
    // prevent https://github.com/ant-design/ant-design/issues/4935
    const versionDefPath = path.join(process.cwd(), 'lib', 'version', 'index.d.ts');
    fs.writeFileSync(
      versionDefPath,
      `declare var _default: "${packageInfo.version}";\nexport default _default;\n`,
    );
    // eslint-disable-next-line
    console.log('Wrote version into lib/version/index.d.ts');

    // Build a entry less file to dist/antd.less
    const componentsPath = path.join(process.cwd(), 'components');
    let componentsLessContent = '';
    // Build components in one file: lib/style/components.less
    fs.readdir(componentsPath, (err, files) => {
      files.forEach(file => {
        if (fs.existsSync(path.join(componentsPath, file, 'style', 'index.less'))) {
          componentsLessContent += `@import "../${path.join(file, 'style', 'index.less')}";\n`;
        }
      });
      fs.writeFileSync(
        path.join(process.cwd(), 'lib', 'style', 'components.less'),
        componentsLessContent,
      );
    });
  }
}
44671
function babelReactResolver$$1(component, props, children) {
  return isReactComponent(component) ? React.createElement(component, props, children) : React.createElement(VueContainer, Object.assign({ component: component }, props), children);
}
135548
function compileINI( project, src ) {
    // Intl.
    if ( src.name( "js" ) === 'mod/$.js' ) {
        // Internationalization for all modules except the special one: '$'.
        src.tag( "intl", "" );
    } else {
        const
        iniName = src.name( "ini" ),
        iniPath = project.srcOrLibPath( iniName );
        if ( iniPath ) {
            src.tag( "intl", CompilerINI.parse( iniPath ) );
        } else {
            src.tag( "intl", "var _=function(){return ''};" );
        }
    }
}