Skip to main content
Version: 3x

Class: RepackPlugin

Webpack plugin, which abstracts configuration of other Re.Pack's plugin to make Webpack config more readable.

example Usage in Webpack config (ESM):

import * as Repack from '@callstack/repack';

export default (env) => {
const {
mode = 'development',
platform,
devServer = undefined,
} = env;

return {
plugins: [
new Repack.RepackPlugin({
mode,
platform,
devServer,
}),
],
};
};

Internally, RepackPlugin configures the following plugins:

RepackPlugin provides a sensible defaults, but can be customized to some extent. If you need more control, it's recommended to remove RepackPlugin and use other plugins directly, eg:

import * as Repack from '@callstack/repack';

new Repack.plugins.AssetsResolverPlugin();

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new RepackPlugin(config)

Constructs new RepackPlugin.

Parameters

NameTypeDescription
configRepackPluginConfigPlugin configuration options.

Defined in

packages/repack/src/webpack/plugins/RepackPlugin.ts:116

Methods

apply

apply(compiler): void

Apply the plugin.

Parameters

NameTypeDescription
compilerCompilerWebpack compiler instance.

Returns

void

Implementation of

WebpackPlugin.apply

Defined in

packages/repack/src/webpack/plugins/RepackPlugin.ts:126