css-loader
Advanced tools
Comparing version 7.1.1 to 7.1.2
@@ -151,16 +151,3 @@ "use strict"; | ||
} | ||
let isTemplateLiteralSupported = false; | ||
if ( | ||
// eslint-disable-next-line no-underscore-dangle | ||
this._compilation && | ||
// eslint-disable-next-line no-underscore-dangle | ||
this._compilation.options && | ||
// eslint-disable-next-line no-underscore-dangle | ||
this._compilation.options.output && | ||
// eslint-disable-next-line no-underscore-dangle | ||
this._compilation.options.output.environment && | ||
// eslint-disable-next-line no-underscore-dangle | ||
this._compilation.options.output.environment.templateLiteral) { | ||
isTemplateLiteralSupported = true; | ||
} | ||
const isTemplateLiteralSupported = (0, _utils.supportTemplateLiteral)(this); | ||
const importCode = (0, _utils.getImportCode)(imports, options); | ||
@@ -167,0 +154,0 @@ let moduleCode; |
@@ -10,7 +10,3 @@ "use strict"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function parseNode(atRule, key, options) { | ||
// Convert only top-level @import | ||
if (atRule.parent.type !== "root") { | ||
return; | ||
} | ||
function isIgnoredAfterName(atRule) { | ||
if (atRule.raws && atRule.raws.afterName && atRule.raws.afterName.trim().length > 0) { | ||
@@ -20,5 +16,8 @@ const lastCommentIndex = atRule.raws.afterName.lastIndexOf("/*"); | ||
if (matched && matched[2] === "true") { | ||
return; | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
function isIgnoredPrevNode(atRule) { | ||
const prevNode = atRule.prev(); | ||
@@ -28,5 +27,13 @@ if (prevNode && prevNode.type === "comment") { | ||
if (matched && matched[2] === "true") { | ||
return; | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
function parseNode(atRule, key, options) { | ||
// Convert only top-level @import | ||
if (atRule.parent.type !== "root") { | ||
return; | ||
} | ||
const isIgnored = isIgnoredAfterName(atRule) || isIgnoredPrevNode(atRule); | ||
@@ -67,6 +74,10 @@ // Nodes do not exists - `@import url('http://') :root {}` | ||
url = (0, _utils.normalizeUrl)(url, isStringValue); | ||
const { | ||
requestable, | ||
needResolve | ||
} = (0, _utils.isURLRequestable)(url, options); | ||
let requestable = false; | ||
let needResolve = false; | ||
if (!isIgnored) { | ||
({ | ||
requestable, | ||
needResolve | ||
} = (0, _utils.isURLRequestable)(url, options)); | ||
} | ||
let prefix; | ||
@@ -73,0 +84,0 @@ if (requestable && needResolve) { |
@@ -30,2 +30,3 @@ "use strict"; | ||
exports.stringifyRequest = stringifyRequest; | ||
exports.supportTemplateLiteral = supportTemplateLiteral; | ||
exports.syntaxErrorFactory = syntaxErrorFactory; | ||
@@ -1037,2 +1038,23 @@ exports.warningFactory = warningFactory; | ||
return obj; | ||
} | ||
function supportTemplateLiteral(loaderContext) { | ||
if (loaderContext.environment && loaderContext.environment.templateLiteral) { | ||
return true; | ||
} | ||
// TODO remove in the next major release | ||
if ( | ||
// eslint-disable-next-line no-underscore-dangle | ||
loaderContext._compilation && | ||
// eslint-disable-next-line no-underscore-dangle | ||
loaderContext._compilation.options && | ||
// eslint-disable-next-line no-underscore-dangle | ||
loaderContext._compilation.options.output && | ||
// eslint-disable-next-line no-underscore-dangle | ||
loaderContext._compilation.options.output.environment && | ||
// eslint-disable-next-line no-underscore-dangle | ||
loaderContext._compilation.options.output.environment.templateLiteral) { | ||
return true; | ||
} | ||
return false; | ||
} |
{ | ||
"name": "css-loader", | ||
"version": "7.1.1", | ||
"version": "7.1.2", | ||
"description": "css loader module for webpack", | ||
@@ -68,11 +68,11 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@babel/cli": "^7.23.4", | ||
"@babel/core": "^7.23.7", | ||
"@babel/preset-env": "^7.23.7", | ||
"@commitlint/cli": "^19.2.1", | ||
"@commitlint/config-conventional": "^19.1.0", | ||
"@babel/cli": "^7.24.5", | ||
"@babel/core": "^7.24.5", | ||
"@babel/preset-env": "^7.24.5", | ||
"@commitlint/cli": "^19.3.0", | ||
"@commitlint/config-conventional": "^19.2.2", | ||
"@webpack-contrib/eslint-config-webpack": "^3.0.0", | ||
"babel-jest": "^29.7.0", | ||
"cross-env": "^7.0.3", | ||
"cspell": "^8.6.1", | ||
"cspell": "^8.7.0", | ||
"del-cli": "^5.1.0", | ||
@@ -90,10 +90,10 @@ "es-check": "^7.1.0", | ||
"lint-staged": "^15.2.2", | ||
"memfs": "^4.8.1", | ||
"mini-css-extract-plugin": "^2.7.5", | ||
"memfs": "^4.9.2", | ||
"mini-css-extract-plugin": "^2.9.0", | ||
"npm-run-all": "^4.1.5", | ||
"postcss-loader": "^8.1.1", | ||
"postcss-preset-env": "^9.5.4", | ||
"postcss-preset-env": "^9.5.9", | ||
"prettier": "^3.2.5", | ||
"sass": "^1.69.7", | ||
"sass-loader": "^14.1.1", | ||
"sass": "^1.76.0", | ||
"sass-loader": "^14.2.1", | ||
"standard-version": "^9.5.0", | ||
@@ -100,0 +100,0 @@ "strip-ansi": "^6.0.0", |
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
141386
2304