1
1
module . exports = ( api , options ) => {
2
2
api . chainWebpack ( webpackConfig => {
3
3
const resolveLocal = require ( '../util/resolveLocal' )
4
+ const getAssetPath = require ( '../util/getAssetPath' )
4
5
const inlineLimit = 10000
5
6
6
7
webpackConfig
@@ -65,7 +66,7 @@ module.exports = (api, options) => {
65
66
. loader ( 'url-loader' )
66
67
. options ( {
67
68
limit : inlineLimit ,
68
- name : `img/[name].[hash:8].[ext]`
69
+ name : getAssetPath ( options , `img/[name].[hash:8].[ext]` )
69
70
} )
70
71
71
72
// do not base64-inline SVGs.
@@ -76,7 +77,7 @@ module.exports = (api, options) => {
76
77
. use ( 'file-loader' )
77
78
. loader ( 'file-loader' )
78
79
. options ( {
79
- name : `img/[name].[hash:8].[ext]`
80
+ name : getAssetPath ( options , `img/[name].[hash:8].[ext]` )
80
81
} )
81
82
82
83
webpackConfig . module
@@ -86,7 +87,7 @@ module.exports = (api, options) => {
86
87
. loader ( 'url-loader' )
87
88
. options ( {
88
89
limit : inlineLimit ,
89
- name : `media/[name].[hash:8].[ext]`
90
+ name : getAssetPath ( options , `media/[name].[hash:8].[ext]` )
90
91
} )
91
92
92
93
webpackConfig . module
@@ -96,7 +97,7 @@ module.exports = (api, options) => {
96
97
. loader ( 'url-loader' )
97
98
. options ( {
98
99
limit : inlineLimit ,
99
- name : `fonts/[name].[hash:8].[ext]`
100
+ name : getAssetPath ( options , `fonts/[name].[hash:8].[ext]` )
100
101
} )
101
102
102
103
// Other common pre-processors ---------------------------------------------
0 commit comments