Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Provide the PathLocationStrategy in development mode #1339

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/dev-server/http-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export function createHttpServer(config: ServeConfig): express.Application {
setupProxies(app);
}

if (config.isPathLocationStrategy) {
app.get('*', serveIndex);
}

return app;
}

Expand Down
4 changes: 2 additions & 2 deletions src/dev-server/injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function getDevLoggerScript(rootDir: string, notifyOnConsoleLog: boolean, notifi
return `
${LOGGER_HEADER}
<script>var IonicDevServerConfig=${ionDevServer};</script>
<link href="${LOGGER_DIR}/ion-dev.css?v=${appScriptsVersion}" rel="stylesheet">
<script src="${LOGGER_DIR}/ion-dev.js?v=${appScriptsVersion}"></script>
<link href="/${LOGGER_DIR}/ion-dev.css?v=${appScriptsVersion}" rel="stylesheet">
<script src="/${LOGGER_DIR}/ion-dev.js?v=${appScriptsVersion}"></script>
`;
}
1 change: 1 addition & 0 deletions src/dev-server/serve-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface ServeConfig {
notifyOnConsoleLog: boolean;
useProxy: boolean;
devapp: boolean;
isPathLocationStrategy: boolean;
}
export const LOGGER_DIR = '__ion-dev-server';
export const IONIC_LAB_URL = '/ionic-lab';
Expand Down
7 changes: 6 additions & 1 deletion src/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export function serve(context: BuildContext) {
useServerLogs: useServerLogs(context),
useProxy: useProxy(context),
notifyOnConsoleLog: sendClientConsoleLogs(context),
devapp: false
devapp: false,
isPathLocationStrategy: isPathLocationStrategy(context)
};

createNotificationServer(config);
Expand Down Expand Up @@ -163,3 +164,7 @@ function useProxy(context: BuildContext): boolean {
function sendClientConsoleLogs(context: BuildContext): boolean {
return hasConfigValue(context, '--consolelogs', '-c', 'ionic_consolelogs', false);
}

function isPathLocationStrategy(context: BuildContext): boolean {
return hasConfigValue(context, '--pathlocationstrategy', null, 'ionic_pathlocationstrategy', false);
}