diff --git a/lib/index.js b/lib/index.js index af06f8f..ec8e396 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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)