PromucFlow_constructor/app/client/craco.dev.config.js
Diljit 992790d2c0
chore: Prefetch consolidated api using service worker (#33306)
## 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
2024-05-16 18:03:28 +05:30

51 lines
1.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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: [
// Dont 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 were extending this array.)
/\.map$/,
/^manifest.*\.js$/,
// Dont cache the root html file
/index\.html/,
// Dont cache LICENSE.txt files emitted by CRA
// when a chunk includes some license comments
/LICENSE\.txt/,
// Dont 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
],
}),
],
},
});