diff --git a/index.mjs b/index.mjs index 28eea7f..caac7a1 100644 --- a/index.mjs +++ b/index.mjs @@ -3,7 +3,11 @@ import {readFileSync} from 'node:fs'; import {resolve, basename, extname, dirname, relative, join} from 'node:path'; -export function createConfig (manifestPathRelative, options, createConfig) { +export function createConfig ({ + manifest: manifestPathRelative, + scriptPlugins = [], + sourcemap, +}) { const manifestPath = resolve(process.cwd(), manifestPathRelative); const manifestDirname = dirname(manifestPath); @@ -109,15 +113,13 @@ export function createConfig (manifestPathRelative, options, createConfig) { const platform = 'firefox'; return [ ...scripts.map(entrypointPath => ({ - // Get configuration options for this entrypoint from the caller - ...createConfig(), - // Overwrite input and output options input: relative(process.cwd(), entrypointPath), output: { file: getOutputPathRelative('build', platform, entrypointPath, 'js'), format: 'iife', - sourcemap: options.sourcemap, + sourcemap, }, + plugins: scriptPlugins, })), // A special step that processes the manifest and copies over non-JS