liferay-npm-bundler-preset-reactjs
Version:
liferay npm bundler preset react
54 lines (53 loc) • 2.13 kB
TypeScript
/**
* SPDX-FileCopyrightText: © 2020 Liferay, Inc. <https://liferay.com>
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
import { Project } from '.';
import { BundlerTransformPluginState } from '../api/plugins';
import PkgDesc from '../pkg-desc';
import { BundlerPluginDescriptor, VersionInfo } from './types';
/**
* Defines configuration for the transform step.
*/
export default class Transform {
constructor(project: Project);
/**
* Get paths of files to be left untouched by babel
* @return array of output-relative globs (as defined by `globby`) to avoid
* when processing with Babel
*/
get babelIgnores(): string[];
/**
* Get all available information about versions of loaders used for the
* build.
* @return a Map where keys are package names
*/
get versionsInfo(): Map<string, VersionInfo>;
/**
* Get Babel config for a given package.
*
* @remarks
* Note that `presets` and `plugins` are returned as written in the
* configuration without any processing. If you want to get the plugins
* associated to a babel configuration you must call {@link getBabelPlugins}
* instead.
*
* @param pkg the package descriptor
* @return a Babel configuration object as defined by its API
*/
getBabelConfig(pkg: PkgDesc): object;
/**
* Load Babel plugins from a given package's configuration
*
* @return an array of one item per plugin where the item is an array of a
* function and an object with the options
*/
getBabelPlugins(pkg: PkgDesc): [() => any, object][];
getPostPluginDescriptors(pkg: PkgDesc): BundlerPluginDescriptor<BundlerTransformPluginState>[];
getPrePluginDescriptors(pkg: PkgDesc): BundlerPluginDescriptor<BundlerTransformPluginState>[];
_concatAllPluginNames(pluginNames: string[], cfg: object): string[];
_concatBabelPluginNames(pluginNames: string[], cfg: object[]): string[];
_concatBundlerPluginNames(pluginNames: string[], cfg: (string | [])[]): string[];
private readonly _project;
private _versionsInfo;
}