Skip to content

Commit

Permalink
feat: 🚀 extract the vite public configuration and inject it separatel…
Browse files Browse the repository at this point in the history
…y under the sub application
  • Loading branch information
limuen committed Jun 18, 2024
1 parent 6808c99 commit e29b379
Show file tree
Hide file tree
Showing 6 changed files with 13,203 additions and 10,355 deletions.
6 changes: 5 additions & 1 deletion apps/react-low-code/.env
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
VITE_GLOB_APP_TITLE = React-Low-Code
VITE_GLOB_APP_TITLE = React-Low-Code

VITE_OPEN = true

VITE_REPORT = false
2 changes: 2 additions & 0 deletions apps/react-low-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"devDependencies": {
"@limuen/tsconfig": "workspace:*",
"@limuen/viteconfig": "workspace:*",
"@vitejs/plugin-react-swc": "^3.5.0",
"vite-plugin-checker": "^0.6.2",
"@types/babel__standalone": "^7.1.7",
"@types/prettier": "^2.6.2",
"@types/react": "^18.2.66",
Expand Down
6 changes: 5 additions & 1 deletion apps/react-low-code/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { defineConfig, mergeConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import checker from "vite-plugin-checker";
import viteConfig from "@limuen/viteconfig";

export default defineConfig(configEnv => {
return mergeConfig(viteConfig(configEnv), {});
return mergeConfig(viteConfig(configEnv), {
plugins: [react(), checker({ typescript: true })]
});
});
2 changes: 0 additions & 2 deletions packages/viteconfig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
"build": "tsup"
},
"dependencies": {
"@vitejs/plugin-react-swc": "^3.5.0",
"rollup-plugin-visualizer": "^5.12.0",
"vite": "^5.2.11",
"vite-plugin-checker": "^0.6.2",
"vite-plugin-compression": "^0.5.1"
},
"devDependencies": {
Expand Down
5 changes: 0 additions & 5 deletions packages/viteconfig/src/scripts/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { PluginOption } from "vite";
import react from "@vitejs/plugin-react-swc";
import checker from "vite-plugin-checker";
import { visualizer } from "rollup-plugin-visualizer";
import viteCompression from "vite-plugin-compression";

Expand All @@ -12,9 +10,6 @@ export const createVitePlugins = (viteEnv: ViteEnv): (PluginOption | PluginOptio
const { VITE_REPORT } = viteEnv;

return [
react(),
// esLint error messages are displayed on the browser interface
checker({ typescript: true }),
// Create a packaged compression configuration
createCompression(viteEnv),
// Whether to generate package preview, analyze dependent package size for optimization
Expand Down
Loading

0 comments on commit e29b379

Please sign in to comment.