11module . exports = ( api , options ) => {
22 api . chainWebpack ( webpackConfig => {
33 const resolveLocal = require ( '../util/resolveLocal' )
4+ const getAssetPath = require ( '../util/getAssetPath' )
45 const inlineLimit = 10000
56
67 webpackConfig
@@ -65,7 +66,7 @@ module.exports = (api, options) => {
6566 . loader ( 'url-loader' )
6667 . options ( {
6768 limit : inlineLimit ,
68- name : `img/[name].[hash:8].[ext]`
69+ name : getAssetPath ( options , `img/[name].[hash:8].[ext]` )
6970 } )
7071
7172 // do not base64-inline SVGs.
@@ -76,7 +77,7 @@ module.exports = (api, options) => {
7677 . use ( 'file-loader' )
7778 . loader ( 'file-loader' )
7879 . options ( {
79- name : `img/[name].[hash:8].[ext]`
80+ name : getAssetPath ( options , `img/[name].[hash:8].[ext]` )
8081 } )
8182
8283 webpackConfig . module
@@ -86,7 +87,7 @@ module.exports = (api, options) => {
8687 . loader ( 'url-loader' )
8788 . options ( {
8889 limit : inlineLimit ,
89- name : `media/[name].[hash:8].[ext]`
90+ name : getAssetPath ( options , `media/[name].[hash:8].[ext]` )
9091 } )
9192
9293 webpackConfig . module
@@ -96,7 +97,7 @@ module.exports = (api, options) => {
9697 . loader ( 'url-loader' )
9798 . options ( {
9899 limit : inlineLimit ,
99- name : `fonts/[name].[hash:8].[ext]`
100+ name : getAssetPath ( options , `fonts/[name].[hash:8].[ext]` )
100101 } )
101102
102103 // Other common pre-processors ---------------------------------------------
0 commit comments