問題タブ [contextroot]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
angular - Angular: localhost で npm start を使用してカスタム コンテキスト ルートでアプリケーションを提供する
この構成でポート 4300 で開始する Angular アプリケーションがあります。
アプリは次の URL にアクセスできます。
http://localhost:4300/#/index.html
「/myApp/」のようなコンテキストルートで提供したい
アプリケーションは常に で開始するnpm start必要があり、次の URL にアクセスしたい:
http://localhost:4300/myApp/#/index.html
どうすればいいですか?
私が試したことはすべてうまくいきません:
- 設定
<base href="/myApp/">がうまくいかない - 設定
"build": "ng build --prod --base-href=myApp"がうまくいかない
どんな助けでも大歓迎です。