@cedarjs/prerender 1.0.0-canary.12469 → 1.0.0-canary.12470
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildAndImport.d.ts","sourceRoot":"","sources":["../../src/build-and-import/buildAndImport.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AActC,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"buildAndImport.d.ts","sourceRoot":"","sources":["../../src/build-and-import/buildAndImport.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AActC,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAmIlD"}
|
|
@@ -142,10 +142,9 @@ async function buildAndImport(options) {
|
|
|
142
142
|
]
|
|
143
143
|
});
|
|
144
144
|
try {
|
|
145
|
-
const format = options.format ?? (0, import_utils.guessFormat)(options.filepath);
|
|
146
145
|
const { output } = await build.generate({
|
|
147
146
|
dir: outDir,
|
|
148
|
-
format:
|
|
147
|
+
format: (0, import_utils.getPkgType)() === "module" ? "es" : "cjs",
|
|
149
148
|
exports: "auto",
|
|
150
149
|
sourcemap: "inline"
|
|
151
150
|
});
|
|
@@ -3,7 +3,7 @@ export declare const JS_EXT_RE: RegExp;
|
|
|
3
3
|
export type RequireFunction = (outfile: string, ctx: {
|
|
4
4
|
format: 'cjs' | 'esm';
|
|
5
5
|
}) => any;
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function getPkgType(): any;
|
|
7
7
|
export declare const getRandomId: () => string;
|
|
8
8
|
export declare function isValidJsFile(filepath: string): boolean;
|
|
9
9
|
import type { OutputChunk } from 'rollup';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/build-and-import/utils.ts"],"names":[],"mappings":"AAIA,sCAAsC;AACtC,eAAO,MAAM,SAAS,QAA2B,CAAA;AAEjD,MAAM,MAAM,eAAe,GAAG,CAC5B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE;IAAE,MAAM,EAAE,KAAK,GAAG,KAAK,CAAA;CAAE,KAC3B,GAAG,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/build-and-import/utils.ts"],"names":[],"mappings":"AAIA,sCAAsC;AACtC,eAAO,MAAM,SAAS,QAA2B,CAAA;AAEjD,MAAM,MAAM,eAAe,GAAG,CAC5B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE;IAAE,MAAM,EAAE,KAAK,GAAG,KAAK,CAAA;CAAE,KAC3B,GAAG,CAAA;AAER,wBAAgB,UAAU,QAYzB;AAED,eAAO,MAAM,WAAW,cAEvB,CAAA;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,WAE7C;AAED,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEzC,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,UA2B9C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,UAExC"}
|
|
@@ -29,8 +29,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var utils_exports = {};
|
|
30
30
|
__export(utils_exports, {
|
|
31
31
|
JS_EXT_RE: () => JS_EXT_RE,
|
|
32
|
+
getPkgType: () => getPkgType,
|
|
32
33
|
getRandomId: () => getRandomId,
|
|
33
|
-
guessFormat: () => guessFormat,
|
|
34
34
|
isValidJsFile: () => isValidJsFile,
|
|
35
35
|
makeFilePath: () => makeFilePath,
|
|
36
36
|
setPrerenderChunkIds: () => setPrerenderChunkIds
|
|
@@ -50,18 +50,6 @@ function getPkgType() {
|
|
|
50
50
|
}
|
|
51
51
|
return void 0;
|
|
52
52
|
}
|
|
53
|
-
function guessFormat(inputFile) {
|
|
54
|
-
const ext = import_node_path.default.extname(inputFile);
|
|
55
|
-
const type = getPkgType();
|
|
56
|
-
if (ext === ".js") {
|
|
57
|
-
return type === "module" ? "esm" : "cjs";
|
|
58
|
-
} else if (ext === ".ts" || ext === ".mts") {
|
|
59
|
-
return "esm";
|
|
60
|
-
} else if (ext === ".mjs") {
|
|
61
|
-
return "esm";
|
|
62
|
-
}
|
|
63
|
-
return "cjs";
|
|
64
|
-
}
|
|
65
53
|
const getRandomId = () => {
|
|
66
54
|
return Math.random().toString(36).substring(2, 15);
|
|
67
55
|
};
|
|
@@ -89,8 +77,8 @@ function makeFilePath(path2) {
|
|
|
89
77
|
// Annotate the CommonJS export names for ESM import in node:
|
|
90
78
|
0 && (module.exports = {
|
|
91
79
|
JS_EXT_RE,
|
|
80
|
+
getPkgType,
|
|
92
81
|
getRandomId,
|
|
93
|
-
guessFormat,
|
|
94
82
|
isValidJsFile,
|
|
95
83
|
makeFilePath,
|
|
96
84
|
setPrerenderChunkIds
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/prerender",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.12470+81de573ac",
|
|
4
4
|
"description": "RedwoodJS prerender",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"test:watch": "vitest watch"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@cedarjs/babel-config": "1.0.0-canary.
|
|
44
|
-
"@cedarjs/project-config": "1.0.0-canary.
|
|
45
|
-
"@cedarjs/router": "1.0.0-canary.
|
|
46
|
-
"@cedarjs/structure": "1.0.0-canary.
|
|
47
|
-
"@cedarjs/web": "1.0.0-canary.
|
|
43
|
+
"@cedarjs/babel-config": "1.0.0-canary.12470",
|
|
44
|
+
"@cedarjs/project-config": "1.0.0-canary.12470",
|
|
45
|
+
"@cedarjs/router": "1.0.0-canary.12470",
|
|
46
|
+
"@cedarjs/structure": "1.0.0-canary.12470",
|
|
47
|
+
"@cedarjs/web": "1.0.0-canary.12470",
|
|
48
48
|
"@rollup/plugin-alias": "5.1.1",
|
|
49
49
|
"@rollup/plugin-commonjs": "28.0.6",
|
|
50
50
|
"@rollup/plugin-node-resolve": "16.0.1",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"unimport": "5.0.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@cedarjs/framework-tools": "1.0.0-canary.
|
|
64
|
+
"@cedarjs/framework-tools": "1.0.0-canary.12470",
|
|
65
65
|
"@types/mime-types": "2.1.4",
|
|
66
66
|
"babel-plugin-tester": "11.0.4",
|
|
67
67
|
"concurrently": "8.2.2",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"react": "react",
|
|
79
79
|
"react-dom": "react-dom"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "81de573ac6072980eb4c6a4e577a50a27ac0ad82"
|
|
82
82
|
}
|