Closed evgeniya-osmakova closed 2 years ago
I've found the solution:
module.exports = function override(config, env) {
config.module.rules[1].oneOf = config.module.rules[1].oneOf.map((one) => {
if (one.options && one.options.name && one.exclude) {
one.exclude = [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/, /\.pdf$/];
}
return one;
}).concat([
{
test:/\.pdf$/,
loader: 'file-loader',
options: { name: "/docs/[name].[ext]"}
}
]);
return config;
};
I need to remove generated random numbers from all pdf files names in my project. (for example license.pdf instead of license.3402bc5d.pdf)
I tried two ways:
file config-overrides.js:
and
But it didn't work. In build I receive 2 files: with number and without. But I need only one