-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f68b3d
commit 52aea1f
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@remix-run/dev": patch | ||
--- | ||
|
||
Vite: Validate that the MDX Rollup plugin, if present, is placed before Remix in Vite config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import dedent from "dedent"; | ||
|
||
import { createProject, viteBuild } from "./helpers/vite.js"; | ||
|
||
test.describe(() => { | ||
let cwd: string; | ||
let buildResult: ReturnType<typeof viteBuild>; | ||
|
||
test.beforeAll(async () => { | ||
cwd = await createProject({ | ||
"vite.config.ts": dedent` | ||
import { unstable_vitePlugin as remix } from "@remix-run/dev"; | ||
import mdx from "@mdx-js/rollup"; | ||
export default { | ||
plugins: [ | ||
remix(), | ||
mdx(), | ||
], | ||
} | ||
`, | ||
}); | ||
|
||
buildResult = viteBuild({ cwd }); | ||
}); | ||
|
||
test("Vite / plugin order validation / MDX", () => { | ||
expect(buildResult.stderr.toString()).toContain( | ||
'Error: The "@mdx-js/rollup" plugin should be placed before the Remix plugin in your Vite config file' | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters