@cedarjs/prerender 1.0.0-canary.12477 → 1.0.0-canary.12478
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/build-and-import/buildAndImport.js +1 -1
- package/dist/build-and-import/rollupPlugins/rollup-plugin-cedarjs-routes-auto-loader.d.ts +1 -1
- package/dist/build-and-import/rollupPlugins/rollup-plugin-cedarjs-routes-auto-loader.d.ts.map +1 -1
- package/dist/build-and-import/rollupPlugins/rollup-plugin-cedarjs-routes-auto-loader.js +7 -14
- package/package.json +8 -8
|
@@ -112,7 +112,7 @@ async function buildAndImport(options) {
|
|
|
112
112
|
}),
|
|
113
113
|
(0, import_rollup_plugin_cedarjs_ignore_html_and_css_imports.ignoreHtmlAndCssImportsPlugin)(),
|
|
114
114
|
(0, import_rollup_plugin_cedarjs_cell.cellTransformPlugin)(),
|
|
115
|
-
(0, import_rollup_plugin_cedarjs_routes_auto_loader.cedarjsRoutesAutoLoaderPlugin)(
|
|
115
|
+
(0, import_rollup_plugin_cedarjs_routes_auto_loader.cedarjsRoutesAutoLoaderPlugin)(),
|
|
116
116
|
(0, import_rollup_plugin_cedarjs_directory_named_imports.cedarjsDirectoryNamedImportPlugin)(),
|
|
117
117
|
(0, import_rollup_plugin_cedarjs_prerender_media_imports.cedarjsPrerenderMediaImportsPlugin)(),
|
|
118
118
|
(0, import_plugin_commonjs.default)(),
|
|
@@ -2,5 +2,5 @@ import type { Plugin } from 'rollup';
|
|
|
2
2
|
export interface PluginOptions {
|
|
3
3
|
forPrerender?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare function cedarjsRoutesAutoLoaderPlugin(
|
|
5
|
+
export declare function cedarjsRoutesAutoLoaderPlugin(): Plugin;
|
|
6
6
|
//# sourceMappingURL=rollup-plugin-cedarjs-routes-auto-loader.d.ts.map
|
package/dist/build-and-import/rollupPlugins/rollup-plugin-cedarjs-routes-auto-loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup-plugin-cedarjs-routes-auto-loader.d.ts","sourceRoot":"","sources":["../../../src/build-and-import/rollupPlugins/rollup-plugin-cedarjs-routes-auto-loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAYpC,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;
|
|
1
|
+
{"version":3,"file":"rollup-plugin-cedarjs-routes-auto-loader.d.ts","sourceRoot":"","sources":["../../../src/build-and-import/rollupPlugins/rollup-plugin-cedarjs-routes-auto-loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAYpC,MAAM,WAAW,aAAa;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AA8BD,wBAAgB,6BAA6B,IAAI,MAAM,CAiJtD"}
|
|
@@ -47,20 +47,13 @@ function withRelativeImports(page) {
|
|
|
47
47
|
relativeImport: (0, import_project_config.ensurePosixPath)(getPathRelativeToSrc(page.importPath))
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
function prerenderLoaderImpl(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}`;
|
|
56
|
-
}
|
|
57
|
-
return `({
|
|
58
|
-
default: globalThis.__REDWOOD__PRERENDER_PAGES[name]
|
|
59
|
-
})`;
|
|
50
|
+
function prerenderLoaderImpl(relativeImport) {
|
|
51
|
+
return `{
|
|
52
|
+
const chunkId = './${relativeImport.split("/").at(-1)}-__PRERENDER_CHUNK_ID.js';
|
|
53
|
+
return require(chunkId);
|
|
54
|
+
}`;
|
|
60
55
|
}
|
|
61
|
-
function cedarjsRoutesAutoLoaderPlugin({
|
|
62
|
-
forPrerender = false
|
|
63
|
-
} = {}) {
|
|
56
|
+
function cedarjsRoutesAutoLoaderPlugin() {
|
|
64
57
|
let pages = (0, import_project_config.processPagesDir)().map(withRelativeImports);
|
|
65
58
|
const duplicatePageImportNames = /* @__PURE__ */ new Set();
|
|
66
59
|
const sortedPageImportNames = pages.map((page) => page.importName).sort();
|
|
@@ -134,7 +127,7 @@ function cedarjsRoutesAutoLoaderPlugin({
|
|
|
134
127
|
}
|
|
135
128
|
const declaration = (0, import_utils.dedent)(8)`const ${importName} = {
|
|
136
129
|
name: "${importName}",
|
|
137
|
-
prerenderLoader: (name) => ${prerenderLoaderImpl(
|
|
130
|
+
prerenderLoader: (name) => ${prerenderLoaderImpl(relativeImport)},
|
|
138
131
|
LazyComponent: lazy(() => import("${relativeImport}"))
|
|
139
132
|
}`;
|
|
140
133
|
declarations.push(declaration);
|
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.12478+507810cd8",
|
|
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.12478",
|
|
44
|
+
"@cedarjs/project-config": "1.0.0-canary.12478",
|
|
45
|
+
"@cedarjs/router": "1.0.0-canary.12478",
|
|
46
|
+
"@cedarjs/structure": "1.0.0-canary.12478",
|
|
47
|
+
"@cedarjs/web": "1.0.0-canary.12478",
|
|
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.12478",
|
|
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": "507810cd835cbb833694fbcc290752ce679b44e1"
|
|
82
82
|
}
|