dumi 2.4.18 → 2.4.19-beta.0
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/features/routes.js +10 -9
- package/package.json +1 -1
package/dist/features/routes.js
CHANGED
|
@@ -140,14 +140,14 @@ var routes_default = (api) => {
|
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
Object.entries(pages).forEach(([, route]) => {
|
|
143
|
-
const { base } = api.config.conventionRoutes;
|
|
144
|
-
route.file = (0, import_plugin_utils.winPath)(import_path.default.resolve(
|
|
143
|
+
const { base: base2 } = api.config.conventionRoutes;
|
|
144
|
+
route.file = (0, import_plugin_utils.winPath)(import_path.default.resolve(base2, route.file));
|
|
145
145
|
routes[route.id] = route;
|
|
146
146
|
});
|
|
147
147
|
docDirs.map(normalizeDocDir).forEach(({ type, dir }) => {
|
|
148
|
-
const
|
|
148
|
+
const base2 = import_path.default.join(api.cwd, dir);
|
|
149
149
|
const dirRoutes = (0, import_core.getConventionRoutes)({
|
|
150
|
-
base,
|
|
150
|
+
base: base2,
|
|
151
151
|
exclude: [/.*(?<!md)$/, /(\/|^)(\.|_)/]
|
|
152
152
|
});
|
|
153
153
|
Object.entries(dirRoutes).forEach(([key, route]) => {
|
|
@@ -157,15 +157,15 @@ var routes_default = (api) => {
|
|
|
157
157
|
route.path = `${pluralType}/${route.path}`.replace(/\/+$/, "/");
|
|
158
158
|
route.absPath = `/${route.path}`;
|
|
159
159
|
}
|
|
160
|
-
route.file = (0, import_plugin_utils.winPath)(import_path.default.resolve(
|
|
160
|
+
route.file = (0, import_plugin_utils.winPath)(import_path.default.resolve(base2, route.file));
|
|
161
161
|
routes[route.id] = route;
|
|
162
162
|
});
|
|
163
163
|
});
|
|
164
164
|
atomDirs.forEach(({ type, subType = "", dir }) => {
|
|
165
|
-
const
|
|
165
|
+
const base2 = import_path.default.join(api.cwd, dir);
|
|
166
166
|
const atomFiles = import_plugin_utils.glob.sync(
|
|
167
167
|
"{*,*/index,*/index.*,*/README,*/README.*}.md",
|
|
168
|
-
{ cwd:
|
|
168
|
+
{ cwd: base2 }
|
|
169
169
|
);
|
|
170
170
|
atomFiles.forEach((file) => {
|
|
171
171
|
const routeFile = (0, import_plugin_utils.winPath)(import_path.default.join((0, import_pluralize.plural)(type), subType, file));
|
|
@@ -176,7 +176,7 @@ var routes_default = (api) => {
|
|
|
176
176
|
path: routePath,
|
|
177
177
|
absPath: `/${routePath}`,
|
|
178
178
|
parentId: docLayoutId,
|
|
179
|
-
file: (0, import_plugin_utils.winPath)(import_path.default.resolve(
|
|
179
|
+
file: (0, import_plugin_utils.winPath)(import_path.default.resolve(base2, file)),
|
|
180
180
|
meta: { _atom_route: true }
|
|
181
181
|
};
|
|
182
182
|
});
|
|
@@ -205,10 +205,11 @@ var routes_default = (api) => {
|
|
|
205
205
|
file: require.resolve("../client/pages/404")
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
|
+
const base = api.config.base;
|
|
208
209
|
routes["demo-render"] = {
|
|
209
210
|
id: "demo-render",
|
|
210
211
|
path: `${import_constants.SP_ROUTE_PREFIX}demos/:id`,
|
|
211
|
-
absPath:
|
|
212
|
+
absPath: `${base}${import_constants.SP_ROUTE_PREFIX}demos/:id`,
|
|
212
213
|
parentId: demoLayoutId,
|
|
213
214
|
file: require.resolve("../client/pages/Demo")
|
|
214
215
|
};
|