Skip to content

Commit

Permalink
Merge branch 'master' into chore/add-example-for-lazy-route
Browse files Browse the repository at this point in the history
  • Loading branch information
tokerson committed May 6, 2024
2 parents 259046f + ecbcb7a commit a058709
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-peas-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-starter-boilerplate": patch
---

Change type to module to disable warning about using cjs vite
5 changes: 5 additions & 0 deletions .changeset/witty-pans-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-starter-boilerplate": minor
---

Split sentry packages to a dedicated sentry chunk
5 changes: 5 additions & 0 deletions .changeset/young-gorillas-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-starter-boilerplate": minor
---

Add build:analyze command
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ e2e/node_modules
e2e/scripts/**/*.js
e2e/testsResults

.credentials.json
.credentials.json
stats.html
File renamed without changes.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ npm run [command_name]
- `start` - Launches the app in development mode on [http://localhost:3000](http://localhost:3000)
- `build` - Compiles and bundles the app for deployment*
- `build:ci` - Build command optimized for CI/CD pipelines
- `build:analyze` - Builds the app and opens the rollup-plugin-visualizer report in the browser
- `typecheck` - Validate the code using TypeScript compiler
- `preview` - Boot up a local static web server that serves application build. It's an easy way to check if the production build looks OK on your local machine
- `test` - Run unit tests with vitest
Expand Down
File renamed without changes.
36 changes: 36 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
"engines": {
"node": ">=20"
},
"type": "module",
"scripts": {
"start": "vite",
"build": "tsc && vite build",
"build:ci": "cross-env VITE_CI=1 vite build",
"build:analyze": "cross-env ANALYZE=1 npm run build",
"typecheck": "tsc --noEmit",
"preview": "vite preview",
"test": "vitest",
Expand Down Expand Up @@ -107,6 +109,7 @@
"msw": "2.2.13",
"plop": "4.0.1",
"prettier": "3.1.1",
"rollup-plugin-visualizer": "5.12.0",
"stylelint": "16.3.1",
"stylelint-config-recommended": "14.0.0",
"vite": "5.2.8",
Expand Down
15 changes: 14 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { defineConfig } from 'vite';
import { defineConfig, type PluginOption } from 'vite';
import react from '@vitejs/plugin-react-swc';
import viteTsconfigPaths from 'vite-tsconfig-paths';
import svgrPlugin from 'vite-plugin-svgr';
import { configDefaults } from 'vitest/config';
import { TanStackRouterVite } from '@tanstack/router-vite-plugin';
import { visualizer } from 'rollup-plugin-visualizer';

const manualChunks = (id: string) => {
if (id.includes('@sentry')) {
return 'sentry';
}
};

/* eslint-disable import/no-default-export */
export default defineConfig({
Expand All @@ -14,13 +21,19 @@ export default defineConfig({
viteTsconfigPaths(),
svgrPlugin(),
TanStackRouterVite(),
process.env.ANALYZE ? (visualizer({ open: true }) as PluginOption) : null,
],
server: {
open: true,
port: 3000,
},
build: {
outDir: 'build',
rollupOptions: {
output: {
manualChunks,
},
},
},
test: {
globals: true,
Expand Down

0 comments on commit a058709

Please sign in to comment.