Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserves resource dir structure and does not hash in dev builds #401

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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$/,
Expand Down
15 changes: 15 additions & 0 deletions src/dist.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down