Skip to content

Commit

Permalink
Fix the URLs of SSR-ed images by configuring the server file-loader, too
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Sep 26, 2019
1 parent e2c7c66 commit e01cd6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ const cssChunkFilename = cssNameFromFilename( outputChunkFilename );
const fileLoader = FileConfig.loader(
// The server bundler express middleware server assets from the hard-coded publicPath `/calypso/evergreen/`.
// This is required so that running calypso via `npm start` doesn't break.
isDevelopment && ! isDesktop
isDevelopment
? {
outputPath: 'images/',
outputPath: 'images',
publicPath: '/calypso/evergreen/images/',
}
: {
Expand Down
4 changes: 3 additions & 1 deletion webpack.config.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* External dependencies
*/
const path = require( 'path' );
// eslint-disable-next-line import/no-extraneous-dependencies
const webpack = require( 'webpack' );
const _ = require( 'lodash' );

Expand All @@ -26,8 +27,9 @@ const FileConfig = require( '@automattic/calypso-build/webpack/file-loader' );
* Internal variables
*/
const isDevelopment = bundleEnv === 'development';

const fileLoader = FileConfig.loader( {
publicPath: '/calypso/images/',
publicPath: isDevelopment ? '/calypso/evergreen/images/' : '/calypso/images/',
emitFile: false, // On the server side, don't actually copy files
} );

Expand Down

0 comments on commit e01cd6e

Please sign in to comment.