Skip to content

Commit e6907cf

Browse files
Update outputPath for file-loader 3.x
1 parent aea5c57 commit e6907cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

webpack.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* External dependencies
33
*/
44
const webpack = require( 'webpack' );
5+
const path = require( 'path' );
56
const ExtractTextPlugin = require( 'extract-text-webpack-plugin' );
67
const WebpackRTLPlugin = require( 'webpack-rtl-plugin' );
78
const SpritePlugin = require( 'svg-sprite-loader/plugin' );
@@ -81,8 +82,9 @@ const config = {
8182
options: {
8283
limit: 8000, // Convert images < 8kb to base64 strings
8384
name: '[name].[ext]',
84-
useRelativePath: true,
85-
outputPath: './public/',
85+
outputPath: ( url, resourcePath, context ) => {
86+
return `./public/${ path.relative( context, resourcePath ).replace( 'resources/assets', '' ) }`
87+
}
8688
},
8789
},
8890
],

0 commit comments

Comments
 (0)