diff --git a/package/rules/file.js b/package/rules/file.js index 5089842ee..e4d0b6b60 100644 --- a/package/rules/file.js +++ b/package/rules/file.js @@ -1,4 +1,4 @@ -const { join } = require('path') +const { join, normalize } = require('path') const { source_path: sourcePath, static_assets_extensions: fileExtensions } = require('../config') module.exports = { @@ -8,7 +8,7 @@ module.exports = { loader: 'file-loader', options: { name(file) { - if (file.includes(sourcePath)) { + if (file.includes(normalize(sourcePath))) { return 'media/[path][name]-[hash].[ext]' } return 'media/[folder]/[name]-[hash:8].[ext]'