Skip to content

Commit

Permalink
feat: expose makeBuild
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey committed Aug 30, 2018
1 parent 42180d5 commit 9ecee3b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ const generateRollupConfig = function(options) {
const settings = getSettings(options);

/* make a build with the specifed settings */
const makeBuild = (buildType, buildOverrides) => {
const makeBuild = (buildType, buildOverrides, buildSettings = settings) => {
const b = Object.assign({}, {
plugins: settings.plugins[buildType],
external: settings.externals[buildType],
input: settings.input
plugins: buildSettings.plugins[buildType],
external: buildSettings.externals[buildType],
input: buildSettings.input
}, buildOverrides);

// map plugin names from strings to primed plugins
Expand All @@ -257,12 +257,12 @@ const generateRollupConfig = function(options) {
return pluginName;
}

return settings.primedPlugins[pluginName];
return buildSettings.primedPlugins[pluginName];
});

const changeOutput = (o) => {
o.banner = settings.banner;
o.globals = settings.globals[buildType];
o.banner = buildSettings.banner;
o.globals = buildSettings.globals[buildType];

return o;
};
Expand Down Expand Up @@ -333,7 +333,7 @@ const generateRollupConfig = function(options) {
}
}

return {builds, settings};
return {builds, settings, makeBuild};
};

module.exports = generateRollupConfig;
Expand Down

0 comments on commit 9ecee3b

Please sign in to comment.