UNPKG

2.76 kBJavaScriptView Raw
1import { resolveModule } from "./production";
2export function resolveModulePaths(type, configuration, dev) {
3 const reactDir = resolveModule("react", configuration, [], dev);
4 const reactDomDir = resolveModule("react-dom", configuration, [], dev);
5 const clientDir = resolveModule("@excitare/client-next", configuration, [], dev);
6 const routesDir = resolveModule("@excitare/routes", configuration, [], dev);
7 const entryNextDir = resolveModule("@excitare/entry-next", configuration, [], dev);
8 const entryGraphqlPath = resolveModule("@excitare/entry-graphql", configuration, [], dev);
9 const entryServiceDir = resolveModule("@excitare/entry-service", configuration, [entryNextDir, entryGraphqlPath], dev);
10 const configurationDir = resolveModule("@excitare/configuration", configuration, [entryServiceDir, entryNextDir, entryGraphqlPath], dev);
11 const cliConfigWebpackPath = resolveModule("@excitare/cli-config-webpack", configuration, [], dev);
12 const cliPath = resolveModule("@excitare/cli", configuration, [], dev);
13 const clientNextPath = type !== "next" ? null : resolveModule("@excitare/client-next", configuration, [], dev);
14 const cliConfigNextPath = type !== "next"
15 ? null
16 : resolveModule("@excitare/cli-config-next", configuration, [clientNextPath, entryNextDir], dev);
17 const graphqlPath = resolveModule("graphql", configuration, [clientNextPath, entryGraphqlPath], dev);
18 const nextServerPath = resolveModule("next-server", configuration, [entryNextDir], dev);
19 const nextPath = resolveModule("next", configuration, [entryNextDir, nextServerPath], dev);
20 const entry = [require.resolve("source-map-support/register"), configuration.entry];
21 if (cliPath == null) {
22 throw new Error("Could not find @excitare/cli from " + __dirname);
23 }
24 const nyckelAuthDir = resolveModule("@nyckel/authentication", configuration, [], dev);
25 const nyckelExpressDir = resolveModule("@nyckel/express-middleware", configuration, [], dev);
26 const nyckelManagementDir = resolveModule("@nyckel/management", configuration, [], dev);
27 const nyckelSessionsDir = resolveModule("@nyckel/sessions", configuration, [], dev);
28 return {
29 reactDir,
30 reactDomDir,
31 entry,
32 entryNextDir,
33 entryGraphqlPath,
34 entryServiceDir,
35 configurationDir,
36 cliConfigNextPath,
37 cliConfigWebpackPath,
38 clientNextPath,
39 cliPath,
40 graphqlPath,
41 nextServerPath,
42 nextPath,
43 clientDir,
44 routesDir,
45 nyckelAuthDir,
46 nyckelExpressDir,
47 nyckelManagementDir,
48 nyckelSessionsDir
49 };
50}
51//# sourceMappingURL=modulePaths.js.map
\No newline at end of file