From 03be5326ce30af5fef9f70d06b5cd2d2db49c899 Mon Sep 17 00:00:00 2001 From: Erin Date: Fri, 28 Jul 2023 05:18:49 -0400 Subject: [PATCH] actually theres no reason to include platforms --- index.mjs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/index.mjs b/index.mjs index 1fcd9c4..92848e4 100644 --- a/index.mjs +++ b/index.mjs @@ -5,7 +5,6 @@ import {resolve, basename, extname, dirname, relative, join} from 'node:path'; export function buildConfig ({ manifest: manifestPathRelative, - platforms = [], outDir = 'build/[platform]', scriptPlugins = [], sourcemap, @@ -13,10 +12,6 @@ export function buildConfig ({ const manifestPath = resolve(process.cwd(), manifestPathRelative); const manifestDirname = dirname(manifestPath); - if (!platforms.length) { - throw new Error('No platforms specified'); - } - // Load the manifest let manifestContent; try { @@ -112,14 +107,11 @@ export function buildConfig ({ const {scripts, styles, assets} = getEntryPointsFromManifest(manifestContent); - return platforms.flatMap(platform => [ + return [ ...scripts.map(entrypointPath => ({ input: relative(process.cwd(), entrypointPath), output: { - file: join( - outDir.replace(/\[platform\]/g, platform), - getOutputFilename(entrypointPath, 'js'), - ), + file: join(outDir, getOutputFilename(entrypointPath, 'js')), format: 'iife', sourcemap, }, @@ -131,10 +123,7 @@ export function buildConfig ({ { input: manifestPathRelative, output: { - file: join( - outDir.replace(/\[platform\]/g, platform), - 'manifest.json' - ), + file: join(outDir, 'manifest.json'), }, plugins: [ { @@ -172,5 +161,5 @@ export function buildConfig ({ }, ], }, - ]); + ]; }