Skip to content

Commit

Permalink
chore: update vite and rollup (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Aug 5, 2023
1 parent 1511caa commit 6e3924a
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 156 deletions.
2 changes: 1 addition & 1 deletion doc-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"gh-pages": "^5.0.0",
"rimraf": "^4.4.1",
"serve": "^14.2.0",
"vite": "^4.3.9",
"vite": "^4.4.8",
"vite-pages-theme-doc": "workspace:*",
"vite-plugin-react-pages": "workspace:*"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-project/template-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@vitejs/plugin-react": "^4.0.1",
"rimraf": "^4.4.1",
"serve": "^14.2.0",
"vite": "^4.3.9",
"vite": "^4.4.8",
"vite-pages-theme-doc": "^4.0.0",
"vite-plugin-react-pages": "^4.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"my-card": "*",
"rimraf": "^4.4.1",
"serve": "^14.2.0",
"vite": "^4.3.9",
"vite": "^4.4.8",
"vite-pages-theme-doc": "^4.0.0",
"vite-plugin-react-pages": "^4.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create-project/template-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@vitejs/plugin-react": "^4.0.1",
"rimraf": "^4.4.1",
"serve": "^14.2.0",
"vite": "^4.3.9",
"vite": "^4.4.8",
"vite-pages-theme-doc": "^4.0.0",
"vite-plugin-react-pages": "^4.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"rimraf": "^4.4.1",
"sass": "^1.63.6",
"serve": "^14.2.0",
"vite": "^4.3.9",
"vite": "^4.4.8",
"vite-plugin-react-pages": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/playground/custom-find-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@vitejs/plugin-react": "^4.0.1",
"rimraf": "^4.4.1",
"serve": "^14.2.0",
"vite": "^4.3.9",
"vite": "^4.4.8",
"vite-pages-theme-doc": "workspace:*",
"vite-plugin-react-pages": "workspace:*"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/custom-find-pages2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@vitejs/plugin-react": "^4.0.1",
"rimraf": "^4.4.1",
"serve": "^14.2.0",
"vite": "^4.3.9",
"vite": "^4.4.8",
"vite-pages-theme-doc": "workspace:*",
"vite-plugin-react-pages": "workspace:*"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"playground-card": "*",
"rimraf": "^4.4.1",
"serve": "^14.2.0",
"vite": "^4.3.9",
"vite": "^4.4.8",
"vite-pages-theme-doc": "workspace:*",
"vite-plugin-react-pages": "workspace:*"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/use-theme-doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@vitejs/plugin-react-swc": "^3.3.2",
"rimraf": "^4.4.1",
"serve": "^14.2.0",
"vite": "^4.3.9",
"vite": "^4.4.8",
"vite-pages-theme-doc": "workspace:*",
"vite-plugin-react-pages": "workspace:*"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
"concurrently": "^7.6.0",
"react": "^18.2.0",
"rimraf": "^4.4.1",
"rollup": "^3.25.1",
"rollup": "^3.27.0",
"typescript": "^4.3.2",
"vite": "^4.3.9"
"vite": "^4.4.8"
},
"dependencies": {
"@mdx-js/rollup": "^2.3.0",
Expand Down
12 changes: 8 additions & 4 deletions packages/react-pages/src/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import * as path from 'path'
import type { PluggableList } from 'unified'
import type { Plugin, IndexHtmlTransformContext, PluginOption } from 'vite'
import type { OutputPlugin } from 'rollup'
import type {
Plugin,
IndexHtmlTransformContext,
PluginOption,
Rollup,
} from 'vite'
import type { staticSiteGenerationConfig } from './types'

import {
Expand Down Expand Up @@ -347,7 +351,7 @@ function createMdxTransformPlugin(): Plugin {
// https://github.com/vitejs/vite-plugin-react/blob/caa9b5330092c70288fcb94ceb96ca42438df2a2/packages/plugin-react/src/index.ts#L170
const newFilePath = filepath.replace(/\.mdx?$/, '.jsx')
const newId = [newFilePath, ...qs].join('?')

return (vitePluginReactTrasnform as any)(code, newId, options)
}
},
Expand All @@ -358,7 +362,7 @@ function createMdxTransformPlugin(): Plugin {
* Some chunk filenames may start with `_`, which will be treated as special resource by github pages. So we need to disable jekyll of github pages.
* https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/
*/
function outputPluginDisableJekyll(): OutputPlugin {
function outputPluginDisableJekyll(): Rollup.OutputPlugin {
return {
name: 'vite-pages-disable-jekyll',
generateBundle() {
Expand Down
2 changes: 1 addition & 1 deletion packages/theme-doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"prism-react-renderer": "^1.3.5",
"rc-footer": "^0.6.8",
"rimraf": "^4.4.1",
"rollup": "^3.25.1",
"rollup": "^3.27.0",
"rollup-plugin-postcss": "^4.0.0",
"tslib": "^2.5.3",
"typescript": "^5.1.3",
Expand Down
Loading

0 comments on commit 6e3924a

Please sign in to comment.