@vercel/remix-builder 5.4.5 → 5.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +28 -8
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2730,14 +2730,34 @@ async function ensureSymlink(target, nodeModulesDir, pkgName) {
|
|
|
2730
2730
|
await import_fs.promises.symlink(relativeTarget, symlinkPath);
|
|
2731
2731
|
(0, import_build_utils.debug)(`Created symlink for "${pkgName}"`);
|
|
2732
2732
|
}
|
|
2733
|
-
function isESM(
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2733
|
+
async function isESM(remixConfigPath) {
|
|
2734
|
+
switch ((0, import_path.extname)(remixConfigPath)) {
|
|
2735
|
+
case ".mjs": {
|
|
2736
|
+
return true;
|
|
2737
|
+
}
|
|
2738
|
+
case ".cjs": {
|
|
2739
|
+
return false;
|
|
2740
|
+
}
|
|
2741
|
+
default: {
|
|
2742
|
+
if (import_semver.default.gte(process.version, "20.19.0")) {
|
|
2743
|
+
const { type } = JSON.parse(
|
|
2744
|
+
await import_fs.promises.readFile(
|
|
2745
|
+
(0, import_path.join)((0, import_path.dirname)(remixConfigPath), "package.json"),
|
|
2746
|
+
"utf8"
|
|
2747
|
+
)
|
|
2748
|
+
);
|
|
2749
|
+
if (type === "module") {
|
|
2750
|
+
return true;
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
try {
|
|
2754
|
+
require_(remixConfigPath);
|
|
2755
|
+
return false;
|
|
2756
|
+
} catch (err) {
|
|
2757
|
+
return err.code === "ERR_REQUIRE_ESM";
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2739
2760
|
}
|
|
2740
|
-
return isESM2;
|
|
2741
2761
|
}
|
|
2742
2762
|
function hasScript(scriptName, pkg) {
|
|
2743
2763
|
const scripts = pkg?.scripts || {};
|
|
@@ -3623,7 +3643,7 @@ var build2 = async ({
|
|
|
3623
3643
|
if (!isHydrogen2 && remixConfigPath && renamedRemixConfigPath) {
|
|
3624
3644
|
await import_fs3.promises.rename(remixConfigPath, renamedRemixConfigPath);
|
|
3625
3645
|
let patchedConfig;
|
|
3626
|
-
if (isESM(renamedRemixConfigPath)) {
|
|
3646
|
+
if (await isESM(renamedRemixConfigPath)) {
|
|
3627
3647
|
patchedConfig = `import config from './${(0, import_path4.basename)(
|
|
3628
3648
|
renamedRemixConfigPath
|
|
3629
3649
|
)}';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/remix-builder",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"homepage": "https://vercel.com/docs",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"semver": "7.5.2",
|
|
33
33
|
"vitest": "2.0.1"
|
|
34
34
|
},
|
|
35
|
-
"VERCEL_REMIX_RUN_DEV_MAX_VERSION": "2.16.
|
|
35
|
+
"VERCEL_REMIX_RUN_DEV_MAX_VERSION": "2.16.6",
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "node ../../utils/build-builder.mjs",
|
|
38
38
|
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand",
|