Skip to content

Commit 0f8aeae

Browse files
committed
test storybook fix for 404 image on hosted storybook
1 parent 3b34b9c commit 0f8aeae

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

packages/fxa-settings/.storybook/webpack.config.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,16 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
module.exports = require('fxa-react/configs/storybooks').customizeWebpackConfig;
5+
const { customizeWebpackConfig } = require('fxa-react/configs/storybooks');
6+
7+
module.exports = (options) => {
8+
const config = customizeWebpackConfig(options);
9+
// Inline jpg/jpeg as base64 data URLs so they resolve correctly when used
10+
// in CSS custom properties (relative URLs resolve against the stylesheet,
11+
// not the document, causing 404s in hosted Storybook).
12+
config.module.rules[0].oneOf.unshift({
13+
test: /\.(jpg|jpeg)$/,
14+
type: 'asset/inline',
15+
});
16+
return config;
17+
};

0 commit comments

Comments
 (0)