@webqit/webflo 0.11.28 → 0.11.30
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/package.json
CHANGED
|
@@ -257,12 +257,13 @@ function declareRoutesObj(gen, routesDir, targetDir, varName, routing) {
|
|
|
257
257
|
const walk = (dir, callback) => {
|
|
258
258
|
Fs.readdirSync(dir).forEach(f => {
|
|
259
259
|
let resource = Path.join(dir, f);
|
|
260
|
-
let
|
|
260
|
+
let _namespace = '/' + Path.relative(routesDir, resource).replace(/\\/g, '/');
|
|
261
|
+
let namespace = _beforeLast(_namespace, '/index.js') || '/';
|
|
261
262
|
if (Fs.statSync(resource).isDirectory()) {
|
|
262
263
|
if (routing.subroots.includes(namespace)) return;
|
|
263
264
|
walk(resource, callback);
|
|
264
265
|
} else {
|
|
265
|
-
let relativePath = Path.relative(_targetDir, resource);
|
|
266
|
+
let relativePath = Path.relative(_targetDir, resource).replace(/\\/g, '/');
|
|
266
267
|
callback(resource, namespace, relativePath);
|
|
267
268
|
}
|
|
268
269
|
});
|
|
@@ -273,7 +274,6 @@ function declareRoutesObj(gen, routesDir, targetDir, varName, routing) {
|
|
|
273
274
|
let indexCount = 0;
|
|
274
275
|
if (Fs.existsSync(_routesDir)) {
|
|
275
276
|
walk(_routesDir, (file, namespace, relativePath) => {
|
|
276
|
-
relativePath = relativePath.replace(/\\/g, '/');
|
|
277
277
|
if (relativePath.endsWith('/index.js')) {
|
|
278
278
|
// Import code
|
|
279
279
|
let routeName = 'index' + (++ indexCount);
|