lib/condenser/processors/node_modules/rollup/dist/shared/index.js in condenser-0.0.8 vs lib/condenser/processors/node_modules/rollup/dist/shared/index.js in condenser-0.0.9
- old
+ new
@@ -1,9 +1,9 @@
/*
@license
- Rollup.js v1.20.2
- Sun, 25 Aug 2019 05:31:46 GMT - commit b1747e49d9659799a8c128d3052e5e5703362c37
+ Rollup.js v1.28.0
+ Sat, 04 Jan 2020 20:12:15 GMT - commit b99758b3a4617769f2371540e530536d5c246692
https://github.com/rollup/rollup
Released under the MIT License.
@@ -11,12 +11,45 @@
'use strict';
var path = require('path');
var module$1 = require('module');
-var version = "1.20.2";
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+function __awaiter(thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try {
+ step(generator.next(value));
+ }
+ catch (e) {
+ reject(e);
+ } }
+ function rejected(value) { try {
+ step(generator["throw"](value));
+ }
+ catch (e) {
+ reject(e);
+ } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+}
+
+var version = "1.28.0";
+
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
const absolutePath = /^(?:\/|(?:[A-Za-z]:)?[\\|/])/;
@@ -69,14 +102,23 @@
};
const getObjectOption = (config, command, name) => {
const commandOption = normalizeObjectOptionValue(command[name]);
const configOption = normalizeObjectOptionValue(config[name]);
if (commandOption !== undefined) {
- return commandOption && configOption ? Object.assign({}, configOption, commandOption) : commandOption;
+ return commandOption && configOption ? Object.assign(Object.assign({}, configOption), commandOption) : commandOption;
}
return configOption;
};
+function ensureArray(items) {
+ if (Array.isArray(items)) {
+ return items.filter(Boolean);
+ }
+ if (items) {
+ return [items];
+ }
+ return [];
+}
const defaultOnWarn = warning => {
if (typeof warning === 'string') {
console.warn(warning);
}
else {
@@ -125,27 +167,30 @@
const validInputOptions = Object.keys(inputOptions);
addUnknownOptionErrors(unknownOptionErrors, Object.keys(config), validInputOptions, 'input option', /^output$/);
const validOutputOptions = Object.keys(outputOptions[0]);
addUnknownOptionErrors(unknownOptionErrors, outputOptions.reduce((allKeys, options) => allKeys.concat(Object.keys(options)), []), validOutputOptions, 'output option');
const validCliOutputOptions = validOutputOptions.filter(option => option !== 'sourcemapPathTransform');
- addUnknownOptionErrors(unknownOptionErrors, Object.keys(command), validInputOptions.concat(validCliOutputOptions, Object.keys(commandAliases), 'config', 'environment', 'silent'), 'CLI flag', /^_|output|(config.*)$/);
+ addUnknownOptionErrors(unknownOptionErrors, Object.keys(command), validInputOptions.concat(validCliOutputOptions, Object.keys(commandAliases), 'config', 'environment', 'silent', 'stdin'), 'CLI flag', /^_|output|(config.*)$/);
return {
inputOptions,
optionError: unknownOptionErrors.length > 0 ? unknownOptionErrors.join('\n') : null,
outputOptions
};
}
function addUnknownOptionErrors(errors, options, validOptions, optionType, ignoredKeys = /$./) {
- const unknownOptions = options.filter(key => validOptions.indexOf(key) === -1 && !ignoredKeys.test(key));
+ const validOptionSet = new Set(validOptions);
+ const unknownOptions = options.filter(key => !validOptionSet.has(key) && !ignoredKeys.test(key));
if (unknownOptions.length > 0)
- errors.push(`Unknown ${optionType}: ${unknownOptions.join(', ')}. Allowed options: ${validOptions.sort().join(', ')}`);
+ errors.push(`Unknown ${optionType}: ${unknownOptions.join(', ')}. Allowed options: ${Array.from(validOptionSet)
+ .sort()
+ .join(', ')}`);
}
function getCommandOptions(rawCommandOptions) {
const external = rawCommandOptions.external && typeof rawCommandOptions.external === 'string'
? rawCommandOptions.external.split(',')
: [];
- return Object.assign({}, rawCommandOptions, { external, globals: typeof rawCommandOptions.globals === 'string'
+ return Object.assign(Object.assign({}, rawCommandOptions), { external, globals: typeof rawCommandOptions.globals === 'string'
? rawCommandOptions.globals.split(',').reduce((globals, globalDefinition) => {
const [id, variableName] = globalDefinition.split(':');
globals[id] = variableName;
if (external.indexOf(id) === -1) {
external.push(id);
@@ -159,22 +204,22 @@
const inputOptions = {
acorn: config.acorn,
acornInjectPlugins: config.acornInjectPlugins,
cache: getOption('cache'),
chunkGroupingSize: getOption('chunkGroupingSize', 5000),
- context: config.context,
+ context: getOption('context'),
experimentalCacheExpiry: getOption('experimentalCacheExpiry', 10),
experimentalOptimizeChunks: getOption('experimentalOptimizeChunks'),
experimentalTopLevelAwait: getOption('experimentalTopLevelAwait'),
external: getExternal(config, command),
inlineDynamicImports: getOption('inlineDynamicImports', false),
input: getOption('input', []),
manualChunks: getOption('manualChunks'),
moduleContext: config.moduleContext,
onwarn: getOnWarn(config, defaultOnWarnHandler),
perf: getOption('perf', false),
- plugins: config.plugins,
+ plugins: ensureArray(config.plugins),
preserveModules: getOption('preserveModules'),
preserveSymlinks: getOption('preserveSymlinks'),
shimMissingExports: getOption('shimMissingExports'),
strictDeprecations: getOption('strictDeprecations', false),
treeshake: getObjectOption(config, command, 'treeshake'),
@@ -188,19 +233,20 @@
function getOutputOptions(config, command = {}) {
const getOption = createGetOption(config, command);
let format = getOption('format');
// Handle format aliases
switch (format) {
+ case undefined:
case 'esm':
case 'module':
format = 'es';
break;
case 'commonjs':
format = 'cjs';
}
return {
- amd: Object.assign({}, config.amd, command.amd),
+ amd: Object.assign(Object.assign({}, config.amd), command.amd),
assetFileNames: getOption('assetFileNames'),
banner: getOption('banner'),
chunkFileNames: getOption('chunkFileNames'),
compact: getOption('compact', false),
dir: getOption('dir'),
@@ -210,21 +256,22 @@
exports: getOption('exports'),
extend: getOption('extend'),
externalLiveBindings: getOption('externalLiveBindings', true),
file: getOption('file'),
footer: getOption('footer'),
- format: format === 'esm' ? 'es' : format,
+ format,
freeze: getOption('freeze', true),
globals: getOption('globals'),
indent: getOption('indent', true),
interop: getOption('interop', true),
intro: getOption('intro'),
name: getOption('name'),
namespaceToStringTag: getOption('namespaceToStringTag', false),
noConflict: getOption('noConflict'),
outro: getOption('outro'),
paths: getOption('paths'),
+ plugins: ensureArray(config.plugins),
preferConst: getOption('preferConst'),
sourcemap: getOption('sourcemap'),
sourcemapExcludeSources: getOption('sourcemapExcludeSources'),
sourcemapFile: getOption('sourcemapFile'),
sourcemapPathTransform: getOption('sourcemapPathTransform'),
@@ -253,11 +300,13 @@
var root = getModule(relativeTo);
return module$1._resolveFilename(requested, root);
};
var requireRelative_1 = requireRelative;
+exports.__awaiter = __awaiter;
exports.commandAliases = commandAliases;
exports.createCommonjsModule = createCommonjsModule;
+exports.ensureArray = ensureArray;
exports.getAliasName = getAliasName;
exports.isAbsolute = isAbsolute;
exports.isPlainPathFragment = isPlainPathFragment;
exports.isRelative = isRelative;
exports.mergeOptions = mergeOptions;