Skip to content

Commit 37b73a0

Browse files
authored
feat(scully): work when whatch mode in scully and on ng build are both enabled (#584)
1 parent a73558d commit 37b73a0

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

libs/scully/src/lib/systemPlugins/storeRoutes.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,23 @@ import { HandledRoute } from '../routerPlugins/addOptionalRoutesPlugin';
44
import { scullyConfig } from '../utils/config';
55
import { createFolderFor } from '../utils/createFolderFor';
66
import { log, logError, yellow } from '../utils/log';
7+
import { watch } from '../utils/cli-options';
78

89
const routesFileName = '/assets/scully-routes.json';
910

1011
export async function storeRoutes(routes: HandledRoute[]) {
1112
const files = [
12-
/** in the angular source folder */
13-
join(scullyConfig.homeFolder, scullyConfig.sourceRoot, routesFileName),
1413
/** in the scully outfolder */
1514
join(scullyConfig.outDir, routesFileName),
1615
/** in the angular dist folder */
1716
join(scullyConfig.homeFolder, scullyConfig.distFolder, routesFileName)
1817
];
18+
if (!watch) {
19+
files.push(
20+
/** in the angular source folder */
21+
join(scullyConfig.homeFolder, scullyConfig.sourceRoot, routesFileName)
22+
);
23+
}
1924
try {
2025
const jsonResult = JSON.stringify(
2126
routes.map(r => ({ route: r.route || '/', ...r.data }))

0 commit comments

Comments
 (0)