Skip to content

Commit

Permalink
Making sure AMP optimizer is bundled (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
dijs authored Jun 15, 2020
1 parent a54ef2d commit 02e4076
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/plugins/withReactStorefront.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ module.exports = ({
}),
)

if (config.externals) {
// Making sure the AMP optimizer is bundled
config.externals = config.externals.filter(name => name !== '@ampproject/toolbox-optimizer')
// These are optional dependencies for the optimizer
// which are not used by default
config.externals.push('jimp')
config.externals.push('probe-image-size')
}

if (process.env.NODE_ENV === 'development') {
// This makes it easier to develop apps against a local clone of react-storefront linked with yalc. Here
// we ensure that the server build recompiles when any linked dependency changes.
Expand Down

0 comments on commit 02e4076

Please sign in to comment.