diff --git a/bin/backed.js b/bin/backed.js index c5555bc..2f78251 100644 --- a/bin/backed.js +++ b/bin/backed.js @@ -12,26 +12,26 @@ class Builder { if (config.format && typeof config.format === 'object') { const formats = config.format; for (let format of formats) { - this.bundle(config, format); + let dest = config.dest; + if (format !== 'iffe') { + switch (format) { + case 'cjs': + dest = dest.replace('.js', '-node.js'); + break; + case 'es': + case 'amd': + dest = dest.replace('.js', `-${format}.js`); + break; + } + } + this.bundle(config, dest, format); } } else { - this.bundle(config, config.format); + this.bundle(config, config.dest, config.format); } } - bundle(config, format) { - let dest = config.dest; - if (format !== 'iffe') { - switch (format) { - case 'cjs': - dest = dest.replace('.js', '-node.js'); - break; - case 'es': - case 'amd': - dest = dest.replace('.js', `-${format}.js`); - break; - } - } + bundle(config, dest, format) { rollup({ entry: `${process.cwd()}/${config.src}`, // Use the previous bundle as starting point. diff --git a/package.json b/package.json index d889a3e..3173a09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "backed-cli", - "version": "0.0.1", + "version": "0.1.0", "description": "The official command line interface for Backed", "homepage": "https://github.com/vandeurenglenn/backed-cli", "author": {