Skip to content

Commit

Permalink
chore: Setup client signalr
Browse files Browse the repository at this point in the history
  • Loading branch information
data-miner00 committed Apr 6, 2024
1 parent 9c689e0 commit b77de3b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ dist/
# MVC Bootstrap Icon source
bootstrap-icon/

# jQuery from node
# Copied node packages
jquery/
jquery-validation/
jquery-validation-unobtrusive/
jquery-validation-unobtrusive/
signalr/
6 changes: 6 additions & 0 deletions src/Linker.Mvc/Views/Shared/_SomeScriptsPartial.cshtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<script src="~/lib/loaded.js"></script>
<environment names="Development">
<script src="~/lib/jquery/jquery.min.js"></script>
<script src="~/lib/signalr/signalr.min.js"></script>
</environment>
<environment names="Staging,Production">
<script
src="https://www.unpkg.com/[email protected]/dist/jquery.min.js"
asp-fallback-src="~/lib/jquery/jquery.min.js"
asp-fallback-test="window.jQuery"
></script>
<script
src="https://unpkg.com/@@microsoft/[email protected]/dist/browser/signalr.min.js"
asp-fallback-src="~/lib/signalr/signalr.min.js"
asp-fallback-test="window.signalR"
></script>
</environment>
4 changes: 3 additions & 1 deletion src/Linker.Mvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"copy:bicon": "powershell ./Scripts/Copy-FolderItems.ps1 -SourceFolder ./node_modules/bootstrap-icons/font/* -DestinationFolder ./wwwroot/lib/bootstrap-icon/",
"copy:jquery": "powershell ./Scripts/Copy-FolderItems.ps1 -SourceFolder ./node_modules/jquery/dist/* -DestinationFolder ./wwwroot/lib/jquery/",
"copy:jquery-v": "powershell ./Scripts/Copy-FolderItems.ps1 -SourceFolder ./node_modules/jquery-validation/* -DestinationFolder ./wwwroot/lib/jquery-validation/",
"copy:jquery-vu": "powershell ./Scripts/Copy-FolderItems.ps1 -SourceFolder ./node_modules/jquery-validation-unobtrusive/dist/* -DestinationFolder ./wwwroot/lib/jquery-validation-unobtrusive/"
"copy:jquery-vu": "powershell ./Scripts/Copy-FolderItems.ps1 -SourceFolder ./node_modules/jquery-validation-unobtrusive/dist/* -DestinationFolder ./wwwroot/lib/jquery-validation-unobtrusive/",
"copy:signalr": "powershell ./Scripts/Copy-FolderItems.ps1 -SourceFolder ./node_modules/@microsoft/signalr/dist/browser/* -DestinationFolder ./wwwroot/lib/signalr/",
"copy": "pnpm copy:bicon && pnpm copy:jquery && pnpm copy:jquery-v && pnpm copy:jquery-vu && pnpm copy:signalr"
},
"keywords": [],
"author": "Shaun Chong <[email protected]>",
Expand Down

0 comments on commit b77de3b

Please sign in to comment.