From 0a43547dc5e64d563650da299e7342fb66022860 Mon Sep 17 00:00:00 2001 From: Pedro Furtado Date: Sat, 23 Jan 2021 10:59:02 -0300 Subject: [PATCH] Update file.js --- package/rules/file.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]'