PromucFlow_constructor/app/client/craco.dev.config.js

51 lines
1.6 KiB
JavaScript
Raw Normal View History

const { merge } = require("webpack-merge");
const WorkboxPlugin = require("workbox-webpack-plugin");
const common = require("./craco.common.config.js");
chore: updated dependencies removed unused dependencies. (#19441) ## Description - Add resolution for json5 dependency to resolve package vulnerabilities. - Remove babel-plugin-styled-components because it was unused. - Related to `react-scripts` , if everything builds and dev server is running as expected we have no issues. Fixes #19448 Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video ## Type of change > Please delete options that are not relevant. - Non-breaking change. ## How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Provide instructions, so we can reproduce. > Please also list any relevant details for your test configuration. > Delete anything that is not important - Manual - Jest - Cypress ### Test Plan - All tests need to pass. - Does not need a regression. ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test Co-authored-by: Aishwarya UR <aishwarya@appsmith.com> Co-authored-by: Anubhav <anubhav@appsmith.com>
2023-01-06 13:42:03 +00:00
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({
chore: Prefetch module apis in service worker (#34003) ## Description This PR has the following changes - Modify the prefetch api cache strategy to handle multiple prefetch requests. - Convert the service worker files from js to ts - Code splitting of CE and EE for service worker utils to handle EE specific changes - Jest test cases for the updated logic Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!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" ### :mag: 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/9511154598> > Commit: 785197e27873e71ed457f785a73d4ea57f379213 > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9511154598&attempt=1" 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 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced API request handling with new utility functions and caching strategies for service worker operations. - Updated service worker configuration to TypeScript for improved type safety and maintainability. - Added type definitions for `node-fetch` to support new service worker functionalities. - **Refactor** - Consolidated `view` and `edit` endpoint URL construction in `ConsolidatedPageLoadApi` for better code maintainability. - **Chores** - Updated dependencies in `package.json` for better development experience and compatibility. - Added tests for new service worker utility functions to ensure reliability and correctness. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-14 11:00:23 +00:00
swSrc: "./src/serviceWorker.ts",
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
],
}),
],
},
});