Skip to content

Instantly share code, notes, and snippets.

@Thorium
Last active August 29, 2015 14:24
Show Gist options
  • Save Thorium/2969a4bd3039f373d6ea to your computer and use it in GitHub Desktop.
Save Thorium/2969a4bd3039f373d6ea to your computer and use it in GitHub Desktop.
How to use Paket also in JavaScript references: How to get Bower-components without npm and Node.js
lib/
paket-files/
[Pp]ackages/
source https://www.nuget.org/api/v2
//Server backend side:
nuget FAKE
nuget Microsoft.AspNet.WebApi.OwinSelfHost
//etc.
//Javascript-side:
// I did found these from http://bower.io/search/
// Let's take the whole Bower-foundation component and just one file from SignalR:
github zurb/bower-foundation
github SignalR/bower-signalr jquery.signalR.min.js
// And some more from my favourite CDNs:
http https://code.jquery.com/ui/1.10.4/jquery-ui.min.js
http https://code.jquery.com/ui/1.10.4/themes/sunny/jquery-ui.min.css
// I want jQuery without version name so it is easier to update, without changing every html!
http http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.4.min.js jquery.min.js
// Fake task to deploy JavaScipts:
Target "Deploy-Clientside-Refs" (fun _ ->
Directory.GetFiles("paket-files", "*.js", SearchOption.AllDirectories)
|> Copy "wwwroot/lib/js"
Directory.GetFiles("paket-files", "*.css", SearchOption.AllDirectories)
|> Copy "wwwroot/lib/css"
)
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta charset="UTF-8" />
<title>Test page</title>
<script type='text/javascript' src='lib/js/jquery.min.js'></script>
<script type='text/javascript' src='lib/js/jquery-ui.min.js'></script>
<script type='text/javascript' src='lib/js/foundation.min.js'></script>
<link rel='stylesheet' type='text/css' href='lib/css/normalize.css' />
<link rel='stylesheet' type='text/css' href='lib/css/jquery-ui.min.css' />
<link rel='stylesheet' type='text/css' href='lib/css/foundation.css' />
<script type="text/javascript">
$(document).ready(function () {
$(document).foundation();
});
</script>
</head>
<body>
<!-- this is a testdemo.html in wwwroot-folder -->
Hello!
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment