test/dummy/node_modules/@rails/webpacker/package/rules/file.js in disco_app-0.18.0 vs test/dummy/node_modules/@rails/webpacker/package/rules/file.js in disco_app-0.18.1
- old
+ new
@@ -1,19 +1,20 @@
-const { join } = require('path')
+const { join, normalize } = require('path')
const { source_path: sourcePath, static_assets_extensions: fileExtensions } = require('../config')
module.exports = {
test: new RegExp(`(${fileExtensions.join('|')})$`, 'i'),
use: [
{
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]'
},
+ esModule: false,
context: join(sourcePath)
}
}
]
}