Skip to content

Commit

Permalink
Merge pull request #3 from chuckdumont/work
Browse files Browse the repository at this point in the history
Fix issue #2
  • Loading branch information
chuckdumont authored Jul 16, 2018
2 parents 826d08d + f379f83 commit ff2b283
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/node_modules/
package-lock.json
6 changes: 4 additions & 2 deletions lib/I18nExtractorPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,11 @@ module.exports = class I18nExtractorPlugin {
throw new Error(`Error referencing promise polyfill: ${options.promisePolyfill}`);
}
}
buf.push(`Promise.all(loadLanguageChunks(${JSON.stringify(chunk.id)})).then(function() { ${BLOCK_COMMENT}`);
buf.push(`var langPromises = loadLanguageChunks(${JSON.stringify(chunk.id)}); ${BLOCK_COMMENT}`);
buf.push(`function startupFn() { ${BLOCK_COMMENT}`);
buf.push(Template.indent(source));
buf.push(`}); ${BLOCK_COMMENT}`);
buf.push(`} ${BLOCK_COMMENT}`);
buf.push(`return (langPromises.length) ? Promise.all(langPromises).then(startupFn) : startupFn(); ${BLOCK_COMMENT}`);
return Template.asString(buf);
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webpack-i18n-extractor-plugin",
"version": "2.0.1",
"version": "2.0.2",
"peerDependencies": {
"webpack": ">= 4.0.0"
},
Expand Down

0 comments on commit ff2b283

Please sign in to comment.