Skip to content

Commit

Permalink
fix: 去除isCssName的判断
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackgan3 committed Dec 11, 2024
1 parent 5ef88f6 commit f1dcde1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/webpack-plugin/lib/resolver/AddModePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const parseQuery = require('loader-utils').parseQuery
const { matchCondition } = require('../utils/match-condition')
const addInfix = require('../utils/add-infix')
const { JSON_JS_EXT } = require('../utils/const')
const isCSSFileName = require('../utils/is-css-file-name')

module.exports = class AddModePlugin {
constructor (source, mode, options, target) {
Expand Down Expand Up @@ -38,10 +37,7 @@ module.exports = class AddModePlugin {
const queryInfix = queryObj.infix
if (!implicitMode) queryObj.mode = mode
queryObj.infix = `${queryInfix || ''}.${mode}`
// css | stylus | less | sass 中 import file 过滤query,避免在对应的 loader 中无法读取到文件
if (!isCSSFileName(extname)) {
obj.query = stringifyQuery(queryObj)
}
obj.query = stringifyQuery(queryObj)
obj.path = addInfix(resourcePath, mode, extname)
obj.relativePath = request.relativePath && addInfix(request.relativePath, mode, extname)
resolver.doResolve(target, Object.assign({}, request, obj), 'add mode: ' + mode, resolveContext, (err, result) => {
Expand Down

0 comments on commit f1dcde1

Please sign in to comment.