Skip to content

Commit

Permalink
Update file.js (rails#2902)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrofurtado committed Jan 23, 2021
1 parent 2f0f955 commit b46ce72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/rules/file.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -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]'
Expand Down

0 comments on commit b46ce72

Please sign in to comment.