Skip to content
This repository has been archived by the owner on Dec 13, 2019. It is now read-only.

Commit

Permalink
feat: Follow webpack recommendations of not using filename hashes for…
Browse files Browse the repository at this point in the history
… dev build #122
  • Loading branch information
rstoenescu committed Jun 16, 2018
1 parent 6046166 commit 03f0a16
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/build/webpack-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ const
module.exports = function (cfg) {
legacyValidations(cfg)

const chain = new WebpackChain()
const resolveModules = [
appPaths.resolve.app('node_modules'),
appPaths.resolve.cli('node_modules')
]
const
chain = new WebpackChain(),
resourceHash = cfg.ctx.dev ? '' : '.[hash:7]'
resolveModules = [
appPaths.resolve.app('node_modules'),
appPaths.resolve.cli('node_modules')
]

chain.entry('app').add(appPaths.entryFile)
chain.mode(cfg.ctx.dev ? 'development' : 'production')
Expand Down Expand Up @@ -94,7 +96,7 @@ module.exports = function (cfg) {
.loader('url-loader')
.options({
limit: 10000,
name: 'img/[name].[hash:7].[ext]'
name: `img/[name]${resourceHash}.[ext]`
})

chain.module.rule('fonts')
Expand All @@ -103,7 +105,7 @@ module.exports = function (cfg) {
.loader('url-loader')
.options({
limit: 10000,
name: 'fonts/[name].[hash:7].[ext]'
name: `fonts/[name]${resourceHash}.[ext]`
})

chain.module.rule('media')
Expand All @@ -112,7 +114,7 @@ module.exports = function (cfg) {
.loader('url-loader')
.options({
limit: 10000,
name: 'media/[name].[hash:7].[ext]'
name: `media/[name]${resourceHash}.[ext]`
})

injectStyleRules(chain, {
Expand Down

0 comments on commit 03f0a16

Please sign in to comment.