-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Michaël De Boey <[email protected]>
- Loading branch information
1 parent
1fac238
commit 70cac93
Showing
4 changed files
with
43 additions
and
70 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,7 @@ | ||
--- | ||
"@remix-run/dev": patch | ||
--- | ||
|
||
Fix server builds where serverBuildPath extension is `.cjs`. | ||
|
||
Fix a bug that caused the server build file to be emitted into the assets directory if the value of `serverBuildPath` ended in `.cjs`. |
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,35 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import * as fs from "node:fs"; | ||
import * as path from "node:path"; | ||
|
||
import { createFixtureProject, js } from "./helpers/create-fixture.js"; | ||
|
||
test.describe("", () => { | ||
for (let [serverModuleExt, serverModuleFormat, exportStatement] of [ | ||
["mjs", "esm", "export {"], | ||
["cjs", "cjs", "module.exports ="], | ||
]) { | ||
test(`can write .${serverModuleExt} server output module`, async () => { | ||
let projectDir = await createFixtureProject({ | ||
files: { | ||
// Ensure the config is valid ESM | ||
"remix.config.js": js` | ||
export default { | ||
serverModuleFormat: "${serverModuleFormat}", | ||
serverBuildPath: "build/index.${serverModuleExt}", | ||
}; | ||
`, | ||
}, | ||
}); | ||
|
||
let buildPath = path.resolve( | ||
projectDir, | ||
"build", | ||
`index.${serverModuleExt}` | ||
); | ||
expect(fs.existsSync(buildPath), "doesn't exist").toBe(true); | ||
let contents = fs.readFileSync(buildPath, "utf8"); | ||
expect(contents, "no export statement").toContain(exportStatement); | ||
}); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
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