Skip to content

Commit

Permalink
Set output.dir only if output.file and output.dir are not set
Browse files Browse the repository at this point in the history
Fixes #70
  • Loading branch information
ntkme authored and jlmakes committed Mar 14, 2021
1 parent 444c77f commit 263f162
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ function createPreprocessor(preconfig, config, emitter, logger) {
cache: cache.get(originalPath),
})

options.output = Object.assign({}, options.output, {
dir: path.dirname(originalPath)
})
options.output = Object.assign({}, options.output)

if (options.output.dir === undefined && options.output.file === undefined) {
options.output.dir = path.dirname(originalPath)
}

let bundle = await rollup.rollup(options)
cache.set(originalPath, bundle.cache)
Expand Down

0 comments on commit 263f162

Please sign in to comment.