Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(demo): use baseHref=/ instead of baseHref=./ #8526

Merged
merged 6 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npx nx build demo --base-href='/'
- run: npx nx build demo
- name: Debug output
run: tree dist/demo/browser -P '*.html'
- name: Deploy preview
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: taiga-family/ci/actions/setup/[email protected]

- name: Building demo-app of git-branch without cache
run: npx nx build demo -c next --output-path ${{ env.DIST }} --base-href='/'
run: npx nx build demo -c next --output-path ${{ env.DIST }}

- name: Upload cache / ${{ env.CACHE_DIST_KEY }}
uses: actions/cache/[email protected]
Expand Down Expand Up @@ -129,14 +129,6 @@ jobs:
--branch snapshots/demo/next/${{ github.base_ref }} \
https://github.com/taiga-family/taiga-ui.git ${{ env.DIST_NEXT }}

- name: Find and replace baseHref for next snapshot
uses: jacobtomlinson/gha-find-replace@v3
with:
find: '<base href="./">'
replace: '<base href="/">'
include: '${{ env.DIST_NEXT }}/index.html'
regex: false

- name: Serve ${{ env.DIST_NEXT }} in background
run: npx nx serve-compiled demo --path ${{ env.DIST_NEXT }} --port ${{ env.NG_SERVER_PORT }}

Expand Down
10 changes: 2 additions & 8 deletions projects/demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"output": "assets/taiga-ui/icons"
}
],
"baseHref": "./",
"baseHref": "/",
"styles": [
"{projectRoot}/src/normalize.less",
"{projectRoot}/src/styles.less",
Expand Down Expand Up @@ -91,11 +91,8 @@
"statsJson": false,
"progress": false
},
"development": {
"baseHref": "/"
},
"development": {},
"def": {
"baseHref": "/",
"fileReplacements": [
{
"replace": "{projectRoot}/src/emulate/change-detection-strategy.ts",
Expand All @@ -104,7 +101,6 @@
]
},
"shadow": {
"baseHref": "/",
"fileReplacements": [
{
"replace": "{projectRoot}/src/emulate/view-encapsulation.ts",
Expand All @@ -113,13 +109,11 @@
]
},
"fast": {
"baseHref": "/",
"sourceMap": false,
"namedChunks": false,
"statsJson": false
},
"coalescing": {
"baseHref": "/",
"fileReplacements": [
{
"replace": "{projectRoot}/src/emulate/ng-zone-options.ts",
Expand Down
3 changes: 2 additions & 1 deletion projects/demo/src/modules/app/app.providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export const APP_PROVIDERS: Provider[] = [
{
provide: APP_BASE_HREF,
// @note: By default, on webcontainer.io will not be provided APP_BASE_HREF, we use fallback
useFactory: () => inject(DOCUMENT).querySelector('base')?.href || '/',
useFactory: () =>
inject(DOCUMENT).querySelector('base')?.getAttribute('href') || '/',
Comment on lines -63 to +64
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<base href="/v3/">
document.querySelector('base').href; // https://taiga-ui.dev/v3/
document.querySelector('base').getAttribute('href'); // /v3/

},
{
provide: TUI_IS_PLAYWRIGHT,
Expand Down
Loading