i’m currently setting up 2 apps on the same domain using AWS Cloudfront to manage routes between the apps. One of the 2 apps is a React app, based on React-Boilerplate and using offline-plugin to setup service workers. By default, routes of the react app are whitelisted in Cloudfront and the fallback routes are the routes of the other app (/blog for example).
The problem comes from the service workers of the React app which return the default 404 when calling a route of the other app.
I guess my url that should redirect to the other app, based on Cloudfront redirect, (for instance /blog which is a wordpress) is intercepted by the service worker and then return a 404 from the main app.
I've tried some options provided by webpack offline-plugin but my understanding of service-workers is not optimal...
I've tried playing with responseStrategy
, excludes
, ServiceWorkers cacheName
but no success.
new OfflinePlugin({
publicPath: '/',
appShell: '/',
excludes: ['.htaccess'],
caches: {
main: [':rest:'],
additional: ['*.chunk.js'],
},
safeToUseOptionalCaches: true,
}),