Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(deps: Dependencies, dep: string) => ({
...deps,
[dep]: toUpperFirst(toCamelCase(dep))
}),
{}
import rollupBabel from 'rollup-plugin-babel';
import nodeBuiltIns from 'rollup-plugin-node-builtins';
import nodeGlobals from 'rollup-plugin-node-globals';
import nodeResolve from 'rollup-plugin-node-resolve';
import { toUpperFirst, toCamelCase } from 'ramda-extension';
import { hasPkgProp, pkg, Dependencies } from '../utils/pkg';
import parseEnv from '../utils/parseEnv';
import fileExists from '../utils/fileExists';
const format = parseEnv('BUILD_FORMAT');
const minify = parseEnv('BUILD_MINIFY', false);
const filenamePrefix = parseEnv('BUILD_FILENAME_PREFIX', '');
const filenameSuffix = parseEnv('BUILD_FILENAME_SUFFIX', '');
const isNode = parseEnv('BUILD_NODE', false);
const buildName = parseEnv('BUILD_NAME', toUpperFirst(toCamelCase(pkg.name)));
const peerDependencies = Object.keys(pkg.peerDependencies);
const defaultGlobals: Dependencies = peerDependencies.reduce(
(deps: Dependencies, dep: string) => ({
...deps,
[dep]: toUpperFirst(toCamelCase(dep))
}),
{}
);
const filename = [
pkg.name,
filenameSuffix,
`.${format}`,
minify ? '.min' : null,