File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
packages/react-pages/src/node Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1
1
import * as path from 'path'
2
2
import type { PluggableList } from 'unified'
3
3
import type { Plugin , IndexHtmlTransformContext } from 'vite'
4
+ import type { OutputPlugin } from 'rollup'
4
5
5
6
import {
6
7
DefaultPageStrategy ,
@@ -90,6 +91,7 @@ function pluginFactory(opts: PluginConfig = {}): Plugin {
90
91
rollupOptions : {
91
92
output : {
92
93
manualChunks : undefined ,
94
+ plugins : [ outputPluginDisableJekyll ( ) ] ,
93
95
} ,
94
96
} ,
95
97
} ,
@@ -341,3 +343,20 @@ function createMdxTransformPlugin(): Plugin {
341
343
} ,
342
344
}
343
345
}
346
+
347
+ /**
348
+ * 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.
349
+ * https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/
350
+ */
351
+ function outputPluginDisableJekyll ( ) : OutputPlugin {
352
+ return {
353
+ name : 'vite-pages-disable-jekyll' ,
354
+ generateBundle ( ) {
355
+ this . emitFile ( {
356
+ type : 'asset' ,
357
+ fileName : '.nojekyll' ,
358
+ source : '' ,
359
+ } )
360
+ } ,
361
+ }
362
+ }
You can’t perform that action at this time.
0 commit comments