diff --git a/src/base.config.ts b/src/base.config.ts index 9ec057dd..077625ba 100644 --- a/src/base.config.ts +++ b/src/base.config.ts @@ -560,7 +560,7 @@ export default function webpackConfigFactory(args: any): webpack.Configuration { { test: /\.(css|js)$/, issuer: indexHtmlPattern, - loader: 'file-loader?hash=sha512&digest=hex&name=[name].[hash:base64:8].[ext]' + loader: 'file-loader?digest=hex&name=[path][name].[ext]' }, tsLint && { include: allPaths, @@ -639,7 +639,7 @@ export default function webpackConfigFactory(args: any): webpack.Configuration { }, { test: /\.(gif|png|jpe?g|svg|eot|ttf|woff|woff2|ico)$/i, - loader: 'file-loader?hash=sha512&digest=hex&name=[name].[hash:base64:8].[ext]' + loader: 'file-loader?digest=hex&name=[path][name].[ext]' }, { test: /\.m\.css\.js$/, diff --git a/src/dist.config.ts b/src/dist.config.ts index 34b8c590..5b3d4dee 100644 --- a/src/dist.config.ts +++ b/src/dist.config.ts @@ -144,6 +144,21 @@ function webpackConfig(args: any): webpack.Configuration { } return plugin; }); + config.module = { + ...config.module, + rules: ((config.module && config.module.rules) || []).map((rule) => { + if (rule && typeof rule.loader === 'string' && rule.loader.startsWith('file-loader')) { + return { + ...rule, + loader: args.omitHash + ? rule.loader + : 'file-loader?hash=sha512&digest=hex&name=[path][name].[hash:base64:8].[ext]' + }; + } + + return rule; + }) + }; if (Array.isArray(args.compression)) { const compressionPlugins: any = {