Skip to content

Commit

Permalink
Add warmup
Browse files Browse the repository at this point in the history
  • Loading branch information
ClayBenson94 committed Sep 15, 2023
1 parent 9f03f62 commit 64b1df3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "cms-mint-app",
"version": "0.1.0",
"private": true,
"type":"module",
"dependencies": {
"@apollo/client": "^3.6.9",
"@babel/plugin-syntax-class-properties": "^7.12.13",
Expand Down Expand Up @@ -75,6 +76,7 @@
"sass": "^1.57.1",
"subscriptions-transport-ws": "^0.11.0",
"typescript": "^4.5.2",
"vite-plugin-warmup": "^0.1.0",
"wait-on": "^5.2.1",
"yup": "^0.32.8"
},
Expand Down Expand Up @@ -120,26 +122,26 @@
"@babel/core": "^7.22.15",
"@babel/preset-env": "^7.22.15",
"@cypress/webpack-preprocessor": "^6.0.0",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/client-preset": "^4.1.0",
"@storybook/addon-actions": "^7.0",
"@storybook/addon-controls": "^7.0",
"@storybook/addon-essentials": "^7.0",
"@storybook/addon-links": "^7.0",
"@storybook/node-logger": "^7.0",
"@storybook/react": "^7.0",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/client-preset": "^4.1.0",
"@testing-library/jest-dom": "^5.12.0",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^13.5.0",
"@types/json2csv": "^5.0.3",
"@vitejs/plugin-react": "^4.0.4",
"@vitest/coverage-v8": "^0.34.3",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.2",
"apollo-link": "^1.2.14",
"apollo-link-error": "^1.1.13",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.1.3",
"cypress": "^13.1.0",
"apollo-link": "^1.2.14",
"apollo-link-error": "^1.1.13",
"cypress-otp": "^1.0.2",
"enzyme": "^3.10.0",
"eslint": "^7.11.0",
Expand Down
13 changes: 12 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import react from '@vitejs/plugin-react';
import autoprefixer from 'autoprefixer';
import { defineConfig } from 'vite';
import svgrPlugin from 'vite-plugin-svgr';
import { warmup } from 'vite-plugin-warmup';
import viteTsconfigPaths from 'vite-tsconfig-paths';

// https://vitejs.dev/config/
Expand All @@ -16,7 +17,17 @@ export default defineConfig({
transformMixedEsModules: true
}
},
plugins: [react(), viteTsconfigPaths(), svgrPlugin()],
plugins: [
react(),
viteTsconfigPaths(),
svgrPlugin(),
warmup({
// this plugin helps warm up the compiled sass so that the first page load on the
// dev server is not slow
// https://github.com/vitejs/vite/issues/6736#issuecomment-1492974590
clientFiles: ['index.html']
})
],
server: {
watch: {
usePolling: true
Expand Down
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9282,6 +9282,17 @@ fast-glob@^3.1.1:
merge2 "^1.3.0"
micromatch "^4.0.4"

fast-glob@^3.2.12:
version "3.3.1"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4"
integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.2"
merge2 "^1.3.0"
micromatch "^4.0.4"

fast-glob@^3.2.9:
version "3.2.12"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80"
Expand Down Expand Up @@ -15425,6 +15436,13 @@ vite-plugin-svgr@^3.2.0:
"@svgr/core" "^7.0.0"
"@svgr/plugin-jsx" "^7.0.0"

vite-plugin-warmup@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/vite-plugin-warmup/-/vite-plugin-warmup-0.1.0.tgz#3e411a49c7109fd757e6f6747ceedca09d9198ae"
integrity sha512-ep4gvoVsWYwWR/YP3BYg534cbgYy5VDxD8YEL9AcgiXUu3zXQQujVVIX+TpnkJHCHPeY6Fxn0ePrN8tQ43UfAg==
dependencies:
fast-glob "^3.2.12"

vite-tsconfig-paths@^4.2.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/vite-tsconfig-paths/-/vite-tsconfig-paths-4.2.1.tgz#e53b89096b91d31a6d1e26f75999ea8c336a89ed"
Expand Down

0 comments on commit 64b1df3

Please sign in to comment.