Reputation: 105
I am using angluar cli to build my app.
Currently its building the app in dist folder
index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Admin</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="styles.aa8ce79f832f8715c04d.css"></head>
<body>
<app-root>
</app-root>
<script type="text/javascript" src="runtime.d981c7f14a84cffbe02a.js"></script><script type="text/javascript" src="polyfills.c914ea4c8f6edd6e6f45.js"></script><script type="text/javascript" src="scripts.b5ea1a3cf9f89977f873.js"></script><script type="text/javascript" src="main.ebfc576e2cbf5f6d553e.js"></script></body>
</html>
I would like to customize all src path to have /app appended & look like:
<script type="text/javascript" src="/app/runtime.d981c7f14a84cffbe02a.js"></script>
Is there any way to achieve this?
Upvotes: 0
Views: 455
Reputation: 34435
You can use the deploy-url
parameter when building your app
ng build --prod --deploy-url /app/
Upvotes: 1
Reputation: 92
You want to prepend rather than append. Try changing your base href value so that all relative paths start from the app folder From:
<base href="/">
To:
<base href="./">
Upvotes: 0