diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 3405ec67..b21cb769 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -61,6 +61,10 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Setup Git + if: matrix.os == 'windows-latest' + run: git config --global core.autocrlf input + - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} diff --git a/package-lock.json b/package-lock.json index 0f6e9bb4..bd7f0c14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4467,9 +4467,9 @@ } }, "css-loader": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-3.5.2.tgz", - "integrity": "sha512-hDL0DPopg6zQQSRlZm0hyeaqIRnL0wbWjay9BZxoiJBpbfOW4WHfbaYQhwnDmEa0kZUc1CJ3IFo15ot1yULMIQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-3.5.3.tgz", + "integrity": "sha512-UEr9NH5Lmi7+dguAm+/JSPovNjYbm2k3TK58EiwQHzOHH5Jfq1Y+XoP2bQO6TMn7PptMd0opxxedAWcaSTRKHw==", "dev": true, "requires": { "camelcase": "^5.3.1", @@ -4483,7 +4483,7 @@ "postcss-modules-scope": "^2.2.0", "postcss-modules-values": "^3.0.0", "postcss-value-parser": "^4.0.3", - "schema-utils": "^2.6.5", + "schema-utils": "^2.6.6", "semver": "^6.3.0" }, "dependencies": { @@ -13282,9 +13282,9 @@ } }, "sass": { - "version": "1.26.3", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.26.3.tgz", - "integrity": "sha512-5NMHI1+YFYw4sN3yfKjpLuV9B5l7MqQ6FlkTcC4FT+oHbBRUZoSjHrrt/mE0nFXJyY2kQtU9ou9HxvFVjLFuuw==", + "version": "1.26.5", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.26.5.tgz", + "integrity": "sha512-FG2swzaZUiX53YzZSjSakzvGtlds0lcbF+URuU9mxOv7WBh7NhXEVDa4kPKN4hN6fC2TkOTOKqiqp6d53N9X5Q==", "dev": true, "requires": { "chokidar": ">=2.0.0 <4.0.0" diff --git a/package.json b/package.json index ea27f05e..ee655e8e 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "@webpack-contrib/eslint-config-webpack": "^3.0.0", "babel-jest": "^25.4.0", "cross-env": "^7.0.2", - "css-loader": "^3.5.2", + "css-loader": "^3.5.3", "del": "^5.1.0", "del-cli": "^3.0.0", "es-check": "^5.1.0", @@ -72,7 +72,7 @@ "memfs": "^3.1.2", "npm-run-all": "^4.1.5", "prettier": "^2.0.5", - "sass": "^1.26.3", + "sass": "^1.26.5", "sass-loader": "^8.0.2", "semver": "^7.3.2", "standard-version": "^7.1.0", diff --git a/src/index.js b/src/index.js index 41e25cd8..13dfedeb 100644 --- a/src/index.js +++ b/src/index.js @@ -39,15 +39,15 @@ if (module.hot) { function() { ${ esModule - ? `update(content);` - : `var newContent = require(${loaderUtils.stringifyRequest( + ? 'update(content);' + : `content = require(${loaderUtils.stringifyRequest( this, `!!${request}` )}); - newContent = newContent.__esModule ? newContent.default : newContent; + content = content.__esModule ? content.default : content; - update(newContent);` + update(content);` } } ); @@ -118,23 +118,23 @@ if (module.hot) { if (update && refs > 0) { update(content); }` - : `var newContent = require(${loaderUtils.stringifyRequest( + : `content = require(${loaderUtils.stringifyRequest( this, `!!${request}` )}); - newContent = newContent.__esModule ? newContent.default : newContent; + content = content.__esModule ? content.default : content; - if (!isEqualLocals(oldLocals, newContent.locals)) { + if (!isEqualLocals(oldLocals, content.locals)) { module.hot.invalidate(); return; } - oldLocals = newContent.locals; + oldLocals = content.locals; if (update && refs > 0) { - update(newContent); + update(content); }` } } @@ -230,26 +230,26 @@ if (module.hot) { oldLocals = content.locals; update(content);` - : `var newContent = require(${loaderUtils.stringifyRequest( + : `content = require(${loaderUtils.stringifyRequest( this, `!!${request}` )}); - newContent = newContent.__esModule ? newContent.default : newContent; + content = content.__esModule ? content.default : content; - if (typeof newContent === 'string') { - newContent = [[module.id, newContent, '']]; + if (typeof content === 'string') { + content = [[module.id, content, '']]; } - if (!isEqualLocals(oldLocals, newContent.locals)) { + if (!isEqualLocals(oldLocals, content.locals)) { module.hot.invalidate(); return; } - oldLocals = newContent.locals; + oldLocals = content.locals; - update(newContent);` + update(content);` } } ) diff --git a/test/manual/index.html b/test/manual/index.html index 756b5f4f..89155344 100644 --- a/test/manual/index.html +++ b/test/manual/index.html @@ -87,6 +87,10 @@