Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: fix
  • Loading branch information
alexander-akait committed Jan 27, 2021
commit b9376daaf1bd30e06abf0e0c909b97fe6442f4ed
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