Skip to content

Commit b46ce72

Browse files
authored
Update file.js (#2902)
1 parent 2f0f955 commit b46ce72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

package/rules/file.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { join } = require('path')
1+
const { join, normalize } = require('path')
22
const { source_path: sourcePath, static_assets_extensions: fileExtensions } = require('../config')
33

44
module.exports = {
@@ -8,7 +8,7 @@ module.exports = {
88
loader: 'file-loader',
99
options: {
1010
name(file) {
11-
if (file.includes(sourcePath)) {
11+
if (file.includes(normalize(sourcePath))) {
1212
return 'media/[path][name]-[hash].[ext]'
1313
}
1414
return 'media/[folder]/[name]-[hash:8].[ext]'

0 commit comments

Comments
 (0)