From 331473c1840e43da850728e43c93fe38dc78ccb3 Mon Sep 17 00:00:00 2001 From: Katja Lutz Date: Fri, 3 Jul 2020 19:41:11 +0200 Subject: [PATCH] refactor: use rollup dir and entryFileNames options instead of file --- src/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index b5ff1b7c..b83f0b04 100644 --- a/src/index.js +++ b/src/index.js @@ -559,6 +559,10 @@ function createConfig(options, entry, format, writeMeta) { let cache; if (modern) cache = false; + const absMain = resolve(options.cwd, getMain({ options, entry, format })); + const outputDir = dirname(absMain); + const outputEntryFileName = basename(absMain); + let config = { /** @type {import('rollup').InputOptions} */ inputOptions: { @@ -750,7 +754,8 @@ function createConfig(options, entry, format, writeMeta) { }, format: modern ? 'es' : format, name: options.name, - file: resolve(options.cwd, getMain({ options, entry, format })), + dir: outputDir, + entryFileNames: outputEntryFileName, }, };