mini-css-extract-plugin
Advanced tools
Comparing version 2.7.5 to 2.7.6
@@ -145,2 +145,3 @@ "use strict"; | ||
}) { | ||
// @ts-ignore | ||
super(MODULE_TYPE, /** @type {string | undefined} */context); | ||
@@ -621,3 +622,5 @@ this.id = ""; | ||
const renderedModules = Array.from( /** @type {CssModule[]} */ | ||
this.getChunkModules(chunk, chunkGraph)).filter(module => module.type === MODULE_TYPE); | ||
this.getChunkModules(chunk, chunkGraph)).filter(module => | ||
// @ts-ignore | ||
module.type === MODULE_TYPE); | ||
const filenameTemplate = /** @type {string} */ | ||
@@ -695,2 +698,3 @@ | ||
for (const module of modules) { | ||
// @ts-ignore | ||
if (module.type === MODULE_TYPE) { | ||
@@ -697,0 +701,0 @@ obj[/** @type {string} */chunk.id] = 1; |
@@ -66,2 +66,7 @@ "use strict"; | ||
function pitch(request) { | ||
if (this._compiler && this._compiler.options && this._compiler.options.experiments && this._compiler.options.experiments.css && this._module && this._module.type === "css") { | ||
this.emitWarning(new Error('You can\'t use `experiments.css` (`experiments.futureDefaults` enable built-in CSS support by default) and `mini-css-extract-plugin` together, please set `experiments.css` to `false` or set `{ type: "javascript/auto" }` for rules with `mini-css-extract-plugin` in your webpack config (now `mini-css-extract-plugin` does nothing).')); | ||
return; | ||
} | ||
// @ts-ignore | ||
@@ -372,5 +377,14 @@ const options = this.getOptions( /** @type {Schema} */schema); | ||
} | ||
module.exports = { | ||
default: function loader() {}, | ||
pitch | ||
}; | ||
/** | ||
* @this {import("webpack").LoaderContext<LoaderOptions>} | ||
* @param {string} content | ||
*/ | ||
// eslint-disable-next-line consistent-return | ||
function loader(content) { | ||
if (this._compiler && this._compiler.options && this._compiler.options.experiments && this._compiler.options.experiments.css && this._module && this._module.type === "css") { | ||
return content; | ||
} | ||
} | ||
module.exports = loader; | ||
module.exports.pitch = pitch; |
{ | ||
"name": "mini-css-extract-plugin", | ||
"version": "2.7.5", | ||
"version": "2.7.6", | ||
"description": "extracts CSS into separate files", | ||
@@ -33,2 +33,5 @@ "license": "MIT", | ||
"lint": "npm-run-all -l -p \"lint:**\"", | ||
"fix:js": "npm run lint:js -- --fix", | ||
"fix:prettier": "npm run lint:prettier -- --write", | ||
"fix": "npm-run-all -l fix:js fix:prettier", | ||
"prepare": "husky install && npm run build", | ||
@@ -57,8 +60,8 @@ "release": "standard-version", | ||
"@babel/cli": "^7.21.0", | ||
"@babel/core": "^7.21.0", | ||
"@babel/core": "^7.21.4", | ||
"@babel/eslint-parser": "^7.19.1", | ||
"@babel/preset-env": "^7.19.4", | ||
"@commitlint/cli": "^17.4.4", | ||
"@babel/preset-env": "^7.21.4", | ||
"@commitlint/cli": "^17.5.1", | ||
"@commitlint/config-conventional": "^17.4.4", | ||
"@types/node": "^18.14.4", | ||
"@types/node": "^18.15.11", | ||
"@webpack-contrib/eslint-config-webpack": "^3.0.0", | ||
@@ -68,9 +71,9 @@ "babel-jest": "^28.1.3", | ||
"cross-env": "^7.0.3", | ||
"cspell": "^6.27.0", | ||
"css-loader": "^6.7.3", | ||
"cspell": "^6.31.1", | ||
"css-loader": "^6.7.4", | ||
"del": "^6.0.0", | ||
"del-cli": "^4.0.0", | ||
"es-check": "^7.1.0", | ||
"eslint": "^8.35.0", | ||
"eslint-config-prettier": "^8.6.0", | ||
"eslint": "^8.37.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
@@ -82,13 +85,13 @@ "file-loader": "^6.2.0", | ||
"jsdom": "^19.0.0", | ||
"lint-staged": "^12.3.4", | ||
"lint-staged": "^13.2.1", | ||
"memfs": "^3.4.13", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.8.4", | ||
"sass": "^1.58.3", | ||
"prettier": "^2.8.7", | ||
"sass": "^1.60.0", | ||
"sass-loader": "^12.6.0", | ||
"standard-version": "^9.3.0", | ||
"typescript": "^4.9.5", | ||
"webpack": "^5.74.0", | ||
"webpack": "^5.83.1", | ||
"webpack-cli": "^4.9.2", | ||
"webpack-dev-server": "^4.11.1" | ||
"webpack-dev-server": "^4.13.2" | ||
}, | ||
@@ -95,0 +98,0 @@ "keywords": [ |
@@ -13,3 +13,3 @@ <div align="center"> | ||
[![coverage][cover]][cover-url] | ||
[![chat][chat]][chat-url] | ||
[![discussion][discussion]][discussion-url] | ||
[![size][size]][size-url] | ||
@@ -573,2 +573,4 @@ | ||
{ | ||
// If you enable `experiments.css` or `experiments.futureDefaults`, please uncomment line below | ||
// type: "javascript/auto", | ||
test: /\.(sa|sc|c)ss$/, | ||
@@ -1215,5 +1217,5 @@ use: [ | ||
[cover-url]: https://codecov.io/gh/webpack-contrib/mini-css-extract-plugin | ||
[chat]: https://badges.gitter.im/webpack/webpack.svg | ||
[chat-url]: https://gitter.im/webpack/webpack | ||
[discussion]: https://img.shields.io/github/discussions/webpack/webpack | ||
[discussion-url]: https://github.com/webpack/webpack/discussions | ||
[size]: https://packagephobia.now.sh/badge?p=mini-css-extract-plugin | ||
[size-url]: https://packagephobia.now.sh/result?p=mini-css-extract-plugin |
@@ -1,15 +0,50 @@ | ||
export type Schema = import("schema-utils/declarations/validate").Schema; | ||
export type Compiler = import("webpack").Compiler; | ||
export type Compilation = import("webpack").Compilation; | ||
export type Chunk = import("webpack").Chunk; | ||
export type Module = import("webpack").Module; | ||
export type Source = import("webpack").sources.Source; | ||
export type AssetInfo = import("webpack").AssetInfo; | ||
export type NormalModule = import("webpack").NormalModule; | ||
export type LoaderOptions = import("./index.js").LoaderOptions; | ||
export type Locals = { | ||
export = loader; | ||
/** | ||
* @this {import("webpack").LoaderContext<LoaderOptions>} | ||
* @param {string} content | ||
*/ | ||
declare function loader( | ||
this: import("webpack").LoaderContext<MiniCssExtractPlugin.LoaderOptions>, | ||
content: string | ||
): string | undefined; | ||
declare namespace loader { | ||
export { | ||
pitch, | ||
Schema, | ||
Compiler, | ||
Compilation, | ||
Chunk, | ||
Module, | ||
Source, | ||
AssetInfo, | ||
NormalModule, | ||
LoaderOptions, | ||
Locals, | ||
TODO, | ||
Dependency, | ||
}; | ||
} | ||
import MiniCssExtractPlugin = require("./index"); | ||
/** | ||
* @this {import("webpack").LoaderContext<LoaderOptions>} | ||
* @param {string} request | ||
*/ | ||
declare function pitch( | ||
this: import("webpack").LoaderContext<MiniCssExtractPlugin.LoaderOptions>, | ||
request: string | ||
): void; | ||
type Schema = import("schema-utils/declarations/validate").Schema; | ||
type Compiler = import("webpack").Compiler; | ||
type Compilation = import("webpack").Compilation; | ||
type Chunk = import("webpack").Chunk; | ||
type Module = import("webpack").Module; | ||
type Source = import("webpack").sources.Source; | ||
type AssetInfo = import("webpack").AssetInfo; | ||
type NormalModule = import("webpack").NormalModule; | ||
type LoaderOptions = import("./index.js").LoaderOptions; | ||
type Locals = { | ||
[key: string]: string | Function; | ||
}; | ||
export type TODO = any; | ||
export type Dependency = { | ||
type TODO = any; | ||
type Dependency = { | ||
identifier: string; | ||
@@ -23,12 +58,1 @@ context: string | null; | ||
}; | ||
/** | ||
* @this {import("webpack").LoaderContext<LoaderOptions>} | ||
* @param {string} request | ||
*/ | ||
export function pitch( | ||
this: import("webpack").LoaderContext<MiniCssExtractPlugin.LoaderOptions>, | ||
request: string | ||
): void; | ||
import MiniCssExtractPlugin = require("./index"); | ||
declare function _default(): void; | ||
export { _default as default }; |
114446
2233
1219