Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/cli/src/commands/server/runServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import loadMetroConfig from '../../tools/loadMetroConfig';

export type Args = {|
assetExts?: string[],
assetPlugins?: string[],
cert?: string,
customLogReporterPath?: string,
host?: string,
Expand Down Expand Up @@ -54,6 +55,12 @@ async function runServer(argv: Array<string>, ctx: ConfigT, args: Args) {
reporter,
});

if (args.assetPlugins) {
metroConfig.transformer.assetPlugins = args.assetPlugins.map(plugin =>
require.resolve(plugin),
);
}

const middlewareManager = new MiddlewareManager({
host: args.host,
port: metroConfig.server.port,
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/src/commands/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ export default {
'Specify any additional folders to be added to the watch list',
parse: (val: string) => val.split(','),
},
{
command: '--assetPlugins [list]',
description:
'Specify any additional asset plugins to be used by the packager by full filepath',
parse: (val: string) => val.split(','),
},
{
command: '--assetExts [list]',
description:
Expand Down