File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1007,10 +1007,9 @@ import.meta.hot.on("rsc:update", () => {
1007
1007
...vitePluginRscMinimal ( rscPluginOptions , manager ) ,
1008
1008
...vitePluginFindSourceMapURL ( ) ,
1009
1009
...vitePluginRscCss ( rscPluginOptions , manager ) ,
1010
- // TODO: delay validateImports option check after config
1011
- ...( rscPluginOptions . validateImports !== false
1012
- ? [ validateImportPlugin ( ) ]
1013
- : [ ] ) ,
1010
+ validateImportPlugin ( {
1011
+ apply : ( ) => rscPluginOptions . validateImports !== false ,
1012
+ } ) ,
1014
1013
scanBuildStripPlugin ( { manager } ) ,
1015
1014
...cjsModuleRunnerPlugin ( ) ,
1016
1015
...globalAsyncLocalStoragePlugin ( ) ,
Original file line number Diff line number Diff line change @@ -3,9 +3,12 @@ import type { Plugin } from 'vite'
3
3
// https://github.com/vercel/next.js/blob/90f564d376153fe0b5808eab7b83665ee5e08aaf/packages/next/src/build/webpack-config.ts#L1249-L1280
4
4
// https://github.com/pcattori/vite-env-only/blob/68a0cc8546b9a37c181c0b0a025eb9b62dbedd09/src/deny-imports.ts
5
5
// https://github.com/sveltejs/kit/blob/84298477a014ec471839adf7a4448d91bc7949e4/packages/kit/src/exports/vite/index.js#L513
6
- export function validateImportPlugin ( ) : Plugin {
6
+ export function validateImportPlugin (
7
+ applyOptions : Pick < Plugin , 'apply' > ,
8
+ ) : Plugin {
7
9
return {
8
10
name : 'rsc:validate-imports' ,
11
+ ...applyOptions ,
9
12
resolveId : {
10
13
order : 'pre' ,
11
14
async handler ( source , importer , options ) {
You can’t perform that action at this time.
0 commit comments