actually theres no reason to include platforms

This commit is contained in:
Erin 2023-07-28 05:18:49 -04:00
parent 01ad1423b2
commit 03be5326ce

View file

@ -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 ({
},
],
},
]);
];
}