Skip to content

Commit

Permalink
fix: use void IIFE for webpack plugin, fixes #1309
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Jul 27, 2019
1 parent 81bbb6a commit 6089822
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ index.js
patch.js
root.js
test/hot/react-dom
coverage
src/webpack/webpackTagCommonJSExports.js
coverage
3 changes: 2 additions & 1 deletion src/webpack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ function transform(source, map) {
// Ideally we'd opt out for one file but this is simpler.
.replace(/['"]use strict['"];/, '')
// eslint comments don't need to end up in the output
.replace(/\/\* (.*) \*\//, '')
.replace(/\/\/ eslint-disable-line .*\n/g, '\n')
.replace(/\/\* global.*\*\//, '')
.split(/\n\s*/)
.join(' ');
}

// Parameterize the helper with the current filename.
const separator = '\n\n;';
const separator = '\n';
const appendText = tagCommonJSExportsSource.replace(/__FILENAME__/g, JSON.stringify(resourcePath));

if (this.sourceMap === false) {
Expand Down
2 changes: 1 addition & 1 deletion src/webpack/webpackTagCommonJSExports.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable global-require, import/no-unresolved, no-var, camelcase, func-names */
/* global __FILENAME__, reactHotLoaderGlobal */

;(function register() {
void (function register() {
// eslint-disable-line no-extra-semi
/* react-hot-loader/webpack */
var safe_require = function() {
Expand Down

0 comments on commit 6089822

Please sign in to comment.