Skip to content

Commit

Permalink
refactor(plugin): switch to options hash
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dmbch committed Nov 14, 2017
1 parent ce2298d commit 64e0f24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 64e0f24

Please sign in to comment.