webpack-contrib / file-loader

File Loader
MIT License
1.86k stars 255 forks source link

Random uppercase directory being generated #398

Closed codingpierogi closed 3 years ago

codingpierogi commented 3 years ago

Expected Behavior

The name option should create a consistent directory casing between multiple builds. I'm using CRA which configures the name to be static/media/[name].[hash:8].[ext] which should always create the lowercased directory names.

Actual Behavior

Randomly the casing for media is being capitalized causing fonts not to load when the app is deployed (i.e. static/MEDIA/[name].[hash:8].[ext]).

Code

{
  loader: require.resolve('file-loader'),
  // Exclude `js` files to keep "css" loader working as it injects
  // its runtime that would otherwise be processed through "file" loader.
  // Also exclude `html` and `json` extensions so they get processed
  // by webpacks internal loaders.
  exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
  options: {
    name: 'static/media/[name].[hash:8].[ext]',
  },
},

How Do We Reproduce?

Run the build numerous times and your bound to see the issue. I've reproduced with team members on the same machines.

alexander-akait commented 3 years ago

Something wrong with your configuration our algorithm for name generation doesn't uppercase anything, if you relly need help please provide reproducible test repo, Run the build numerous times and your bound to see the issue. I've reproduced with team members on the same machines. is not help to debug problem, I will reopen when I reproduce it