Skip to content

Commit 02e4076

Browse files
authored
Making sure AMP optimizer is bundled (#103)
1 parent a54ef2d commit 02e4076

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/plugins/withReactStorefront.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ module.exports = ({
5353
}),
5454
)
5555

56+
if (config.externals) {
57+
// Making sure the AMP optimizer is bundled
58+
config.externals = config.externals.filter(name => name !== '@ampproject/toolbox-optimizer')
59+
// These are optional dependencies for the optimizer
60+
// which are not used by default
61+
config.externals.push('jimp')
62+
config.externals.push('probe-image-size')
63+
}
64+
5665
if (process.env.NODE_ENV === 'development') {
5766
// This makes it easier to develop apps against a local clone of react-storefront linked with yalc. Here
5867
// we ensure that the server build recompiles when any linked dependency changes.

0 commit comments

Comments
 (0)