## Description Prefetch the consolidated API using the service worker. This api is prefetched for the view and edit urls. Fixes [Issue URL](https://github.com/appsmithorg/appsmith/issues/33497) > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9108829019> > Commit: 30e2db9961d444b984560bb034ef87b443318213 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9108829019&attempt=2" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
const { merge } = require("webpack-merge");
|
||
const WorkboxPlugin = require("workbox-webpack-plugin");
|
||
const common = require("./craco.common.config.js");
|
||
|
||
module.exports = merge(common, {
|
||
devServer: {
|
||
client: {
|
||
overlay: {
|
||
warnings: false,
|
||
errors: false,
|
||
},
|
||
},
|
||
},
|
||
optimization: {
|
||
minimize: false,
|
||
},
|
||
cache: {
|
||
type: "filesystem",
|
||
memoryCacheUnaffected: true,
|
||
},
|
||
experiments: {
|
||
cacheUnaffected: true,
|
||
},
|
||
webpack: {
|
||
plugins: [
|
||
new WorkboxPlugin.InjectManifest({
|
||
swSrc: "./src/serviceWorker.js",
|
||
mode: "development",
|
||
swDest: "./pageService.js",
|
||
exclude: [
|
||
// Don’t cache source maps and PWA manifests.
|
||
// (These are the default values of the `exclude` option: https://developer.chrome.com/docs/workbox/reference/workbox-build/#type-WebpackPartial,
|
||
// so we need to specify them explicitly if we’re extending this array.)
|
||
/\.map$/,
|
||
/^manifest.*\.js$/,
|
||
// Don’t cache the root html file
|
||
/index\.html/,
|
||
// Don’t cache LICENSE.txt files emitted by CRA
|
||
// when a chunk includes some license comments
|
||
/LICENSE\.txt/,
|
||
// Don’t cache static icons as there are hundreds of them, and caching them all
|
||
// one by one (as the service worker does it) keeps the network busy for a long time
|
||
// and delays the service worker installation
|
||
/\/*\.svg$/,
|
||
/\.(js|css|html|png|jpg|jpeg|gif)$/, // Exclude JS, CSS, HTML, and image files
|
||
],
|
||
}),
|
||
],
|
||
},
|
||
});
|