mini-css-extract-plugin
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -5,2 +5,10 @@ # Changelog | ||
### [1.1.2](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.1.0...v1.1.2) (2020-10-22) | ||
### Bug Fixes | ||
* compatibility with webpack@4 and webpack@5 for monorepos ([#636](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/636)) ([3413439](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/341343924d96f5d0076f27b98c96f9439bff6347)) | ||
* error when reloading async chunk ([#633](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/633)) ([89e7a0a](https://github.com/webpack-contrib/mini-css-extract-plugin/commit/89e7a0acf08f36711c916a4827ea6afff7028afb)) | ||
### [1.1.1](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.1.0...v1.1.1) (2020-10-20) | ||
@@ -7,0 +15,0 @@ |
@@ -136,2 +136,6 @@ "use strict"; | ||
function reloadStyle(src) { | ||
if (!src) { | ||
return false; | ||
} | ||
var elements = document.querySelectorAll('link'); | ||
@@ -138,0 +142,0 @@ var loaded = false; |
@@ -43,3 +43,2 @@ "use strict"; | ||
} = _webpack.default; | ||
const isWebpack4 = _webpack.version[0] === '4'; | ||
const pluginName = 'mini-css-extract-plugin'; | ||
@@ -92,6 +91,2 @@ const REGEXP_CHUNKHASH = /\[chunkhash(?::(\d+))?\]/i; | ||
} | ||
if (!isWebpack4 && 'hmr' in this.options) { | ||
throw new Error("The 'hmr' option doesn't exist for the mini-css-extract-plugin when using webpack 5 (it's automatically determined)"); | ||
} | ||
} | ||
@@ -102,2 +97,4 @@ /** @param {import("webpack").Compiler} compiler */ | ||
apply(compiler) { | ||
const isWebpack4 = compiler.webpack ? false : _webpack.version[0] === '4'; | ||
if (!isWebpack4) { | ||
@@ -173,3 +170,6 @@ const { | ||
if (chunk instanceof _webpack.default.HotUpdateChunk) return; | ||
if (chunk instanceof _webpack.default.HotUpdateChunk) { | ||
return; | ||
} | ||
const renderedModules = Array.from(this.getChunkModules(chunk, chunkGraph)).filter(module => module.type === _utils.MODULE_TYPE); | ||
@@ -314,3 +314,6 @@ const filenameTemplate = chunk.canBeInitial() ? this.options.filename : this.options.chunkFilename; | ||
const handler = (chunk, set) => { | ||
if (enabledChunks.has(chunk)) return; | ||
if (enabledChunks.has(chunk)) { | ||
return; | ||
} | ||
enabledChunks.add(chunk); // eslint-disable-next-line global-require | ||
@@ -317,0 +320,0 @@ |
@@ -38,3 +38,2 @@ "use strict"; | ||
const pluginName = 'mini-css-extract-plugin'; | ||
const isWebpack4 = _webpack.version[0] === '4'; | ||
@@ -98,2 +97,3 @@ function hotLoader(content, context) { | ||
let source; | ||
const isWebpack4 = childCompiler.webpack ? false : _webpack.version[0] === '4'; | ||
@@ -100,0 +100,0 @@ if (isWebpack4) { |
{ | ||
"name": "mini-css-extract-plugin", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "extracts CSS into separate files", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -713,7 +713,12 @@ <div align="center"> | ||
return recursiveIssuer(m.issuer); | ||
} else if (m.name) { | ||
return m.name; | ||
} else { | ||
return false; | ||
} | ||
const chunks = m.getChunks(); | ||
// For webpack@4 chunks = m._chunks | ||
for (const chunk of chunks) { | ||
return chunk.name; | ||
} | ||
return false; | ||
} | ||
@@ -730,3 +735,3 @@ | ||
fooStyles: { | ||
name: 'foo', | ||
name: 'styles_foo', | ||
test: (m, c, entry = 'foo') => | ||
@@ -738,3 +743,3 @@ m.constructor.name === 'CssModule' && recursiveIssuer(m) === entry, | ||
barStyles: { | ||
name: 'bar', | ||
name: 'styles_bar', | ||
test: (m, c, entry = 'bar') => | ||
@@ -741,0 +746,0 @@ m.constructor.name === 'CssModule' && recursiveIssuer(m) === entry, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89596
1185
878