Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jan 27, 2021
1 parent 5b8ab7e commit b9376da
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ class MiniCssExtractPlugin {
`${webpack.RuntimeGlobals.require}.miniCssF`,
(referencedChunk) => {
if (!referencedChunk.contentHash[MODULE_TYPE]) {
return '';
return false;
}

return referencedChunk.canBeInitial()
Expand Down
2 changes: 1 addition & 1 deletion test/cases/hmr/expected/webpack-5/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ module.exports = function (urlString) {
/******/ // This function allow to reference all chunks
/******/ __webpack_require__.miniCssF = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "" + "main" + ".css";
/******/ return undefined;
/******/ };
/******/ })();
/******/
Expand Down
1 change: 1 addition & 0 deletions test/cases/hmr/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Self from '../../../src';

module.exports = {
entry: './index.css',
mode: 'development',
module: {
rules: [
{
Expand Down
4 changes: 1 addition & 3 deletions test/cases/insert-function/expected/webpack-5/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@
/******/ (() => {
/******/ // This function allow to reference all chunks
/******/ __webpack_require__.miniCssF = (chunkId) => {
/******/ // return url for filenames not based on template
/******/ if (chunkId === 1) return "1.css";
/******/ // return url for filenames based on template
/******/ return "" + "main" + ".css";
/******/ return "" + chunkId + ".css";
/******/ };
/******/ })();
/******/
Expand Down
4 changes: 1 addition & 3 deletions test/cases/insert-string/expected/webpack-5/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@
/******/ (() => {
/******/ // This function allow to reference all chunks
/******/ __webpack_require__.miniCssF = (chunkId) => {
/******/ // return url for filenames not based on template
/******/ if (chunkId === 1) return "1.css";
/******/ // return url for filenames based on template
/******/ return "" + "main" + ".css";
/******/ return "" + chunkId + ".css";
/******/ };
/******/ })();
/******/
Expand Down
4 changes: 1 addition & 3 deletions test/cases/insert-undefined/expected/webpack-5/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@
/******/ (() => {
/******/ // This function allow to reference all chunks
/******/ __webpack_require__.miniCssF = (chunkId) => {
/******/ // return url for filenames not based on template
/******/ if (chunkId === 1) return "1.css";
/******/ // return url for filenames based on template
/******/ return "" + "main" + ".css";
/******/ return "" + chunkId + ".css";
/******/ };
/******/ })();
/******/
Expand Down

0 comments on commit b9376da

Please sign in to comment.