From a7c9b8a078302cf1f6a1a70c24ab6f46e0520e28 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 16 Jun 2020 20:41:14 +0200 Subject: [PATCH] packages/cli: added backend:build --- packages/cli/src/commands/backend/build.ts | 23 ++++++++++++++++++++++ packages/cli/src/index.ts | 5 +++++ 2 files changed, 28 insertions(+) create mode 100644 packages/cli/src/commands/backend/build.ts diff --git a/packages/cli/src/commands/backend/build.ts b/packages/cli/src/commands/backend/build.ts new file mode 100644 index 0000000000..a9cdc51fa9 --- /dev/null +++ b/packages/cli/src/commands/backend/build.ts @@ -0,0 +1,23 @@ +/* + * Copyright 2020 Spotify AB + * + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { buildPackage, Output } from '../../lib/packager'; + +export default async () => { + await buildPackage({ + outputs: new Set([Output.cjs, Output.types]), + }); +}; diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index ea71dc6485..a8b6250a20 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -41,6 +41,11 @@ const main = (argv: string[]) => { .option('--check', 'Enable type checking and linting') .action(lazyAction(() => import('./commands/app/serve'), 'default')); + program + .command('backend:build') + .description('Build a backend plugin') + .action(lazyAction(() => import('./commands/backend/build'), 'default')); + program .command('backend:dev') .description('Start local development server with HMR for the backend')