File tree Expand file tree Collapse file tree 5 files changed +23
-7
lines changed
packages/@vue/cli-service/lib Expand file tree Collapse file tree 5 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -297,7 +297,7 @@ module.exports = class Service {
297
297
resovledFrom = 'inline options'
298
298
}
299
299
300
- // normlaize some options
300
+ // normalize some options
301
301
if ( typeof resolved . baseUrl === 'string' ) {
302
302
resolved . baseUrl = resolved . baseUrl . replace ( / ^ \. \/ / , '' )
303
303
}
Original file line number Diff line number Diff line change @@ -82,7 +82,10 @@ module.exports = (api, options) => {
82
82
. loader ( 'url-loader' )
83
83
. options ( {
84
84
limit : inlineLimit ,
85
- name : getAssetPath ( options , `img/[name].[hash:8].[ext]` )
85
+ name : getAssetPath (
86
+ options ,
87
+ `img/[name]${ options . filenameHashing ? '.[hash:8]' : '' } .[ext]`
88
+ )
86
89
} )
87
90
88
91
// do not base64-inline SVGs.
@@ -93,7 +96,10 @@ module.exports = (api, options) => {
93
96
. use ( 'file-loader' )
94
97
. loader ( 'file-loader' )
95
98
. options ( {
96
- name : getAssetPath ( options , `img/[name].[hash:8].[ext]` )
99
+ name : getAssetPath (
100
+ options ,
101
+ `img/[name]${ options . filenameHashing ? '.[hash:8]' : '' } .[ext]`
102
+ )
97
103
} )
98
104
99
105
webpackConfig . module
@@ -103,7 +109,10 @@ module.exports = (api, options) => {
103
109
. loader ( 'url-loader' )
104
110
. options ( {
105
111
limit : inlineLimit ,
106
- name : getAssetPath ( options , `media/[name].[hash:8].[ext]` )
112
+ name : getAssetPath (
113
+ options ,
114
+ `media/[name]${ options . filenameHashing ? '.[hash:8]' : '' } .[ext]`
115
+ )
107
116
} )
108
117
109
118
webpackConfig . module
@@ -113,7 +122,10 @@ module.exports = (api, options) => {
113
122
. loader ( 'url-loader' )
114
123
. options ( {
115
124
limit : inlineLimit ,
116
- name : getAssetPath ( options , `fonts/[name].[hash:8].[ext]` )
125
+ name : getAssetPath (
126
+ options ,
127
+ `fonts/[name]${ options . filenameHashing ? '.[hash:8]' : '' } .[ext]`
128
+ )
117
129
} )
118
130
119
131
// Other common pre-processors ---------------------------------------------
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ module.exports = (api, options) => {
25
25
const shouldExtract = isProd && extract !== false && ! shadowMode
26
26
const filename = getAssetPath (
27
27
options ,
28
- `css/[name]. [contenthash:8].css` ,
28
+ `css/[name]${ options . filenameHashing ? '. [contenthash:8]' : '' } .css` ,
29
29
true /* placeAtRootIfRelative */
30
30
)
31
31
const extractOptions = Object . assign ( {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ module.exports = (api, options) => {
5
5
const getAssetPath = require ( '../util/getAssetPath' )
6
6
const filename = getAssetPath (
7
7
options ,
8
- `js/[name]${ isLegacyBundle ? `-legacy` : `` } . [chunkhash:8].js`
8
+ `js/[name]${ isLegacyBundle ? `-legacy` : `` } ${ options . filenameHashing ? '. [chunkhash:8]' : '' } .js`
9
9
)
10
10
11
11
webpackConfig
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const { createSchema, validate } = require('@vue/cli-shared-utils')
3
3
const schema = createSchema ( joi => joi . object ( {
4
4
baseUrl : joi . string ( ) . allow ( '' ) ,
5
5
outputDir : joi . string ( ) ,
6
+ filenameHashing : joi . boolean ( ) ,
6
7
assetsDir : joi . string ( ) ,
7
8
indexPath : joi . string ( ) ,
8
9
runtimeCompiler : joi . boolean ( ) ,
@@ -53,6 +54,9 @@ exports.defaults = () => ({
53
54
// where to output built files
54
55
outputDir : 'dist' ,
55
56
57
+ // whether filename will contain hash part
58
+ filenameHashing : true ,
59
+
56
60
// where to put static assets (js/css/img/font/...)
57
61
assetsDir : '' ,
58
62
You can’t perform that action at this time.
0 commit comments