From 64e0f24ff508b1296701571c47dfd55eb130040c Mon Sep 17 00:00:00 2001 From: Daniel Dembach Date: Wed, 8 Nov 2017 22:09:30 +0100 Subject: [PATCH] refactor(plugin): switch to options hash To support the new signature of hops-renderer, signature is changed to options hash. BREAKING CHANGE: Constructor signature changed to options hash instead of discrete args. --- packages/plugin/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/plugin/index.js b/packages/plugin/index.js index 3b168bef6..cb60c6171 100644 --- a/packages/plugin/index.js +++ b/packages/plugin/index.js @@ -9,11 +9,11 @@ function getFileName (location) { return index(location).replace(/^\//, ''); } -module.exports = function Plugin (locations, webpackConfig, watchOptions) { - var render = createRenderer(webpackConfig, watchOptions); +module.exports = function Plugin (options) { + var render = createRenderer(options); this.apply = function (compiler) { compiler.plugin('emit', function (compilation, callback) { - Promise.all((locations || []).map(function (location) { + Promise.all((options.locations || []).map(function (location) { return render(location).then(function (html) { if (html) { compilation.assets[getFileName(location)] = new RawSource(html);