Skip to content

Commit

Permalink
Refactor code to fix lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
paypro-leon committed Jan 9, 2024
1 parent 70d9dc0 commit 70ca392
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions package/rules/file.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const { dirname } = require('path')
const { includePaths } = require('../config')

console.log(includePaths);

module.exports = {
test: /\.(bmp|gif|jpe?g|png|tiff|ico|avif|webp|eot|otf|ttf|woff|woff2|svg)$/,
exclude: /\.(js|mjs|jsx|ts|tsx)$/,
Expand All @@ -11,9 +9,9 @@ module.exports = {
filename: (pathData) => {
let path = dirname(pathData.filename)

for (const includePath of includePaths) {
includePaths.forEach((includePath) => {
path = path.replace(`${includePath}`, '')
}
})

const folders = path.split('/').filter(Boolean)
const foldersWithStatic = ['static', ...folders].join('/')
Expand Down

0 comments on commit 70ca392

Please sign in to comment.