Skip to content

Commit

Permalink
Add build script to build js for github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Dec 7, 2017
1 parent 6e6578c commit 89fde7e
Show file tree
Hide file tree
Showing 6 changed files with 229 additions and 103 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ coverage
lerna-debug.log
.DS_Store
example/swagger-files/directory.json

example/dist
15 changes: 15 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rm -rf example/dist
mkdir example/dist

browserify example/index.jsx \
--extension jsx \
-t [ babelify ] \
-g [ envify --NODE_ENV production ] \
-g uglifyify \
| uglifyjs --compress --mangle > ./example/dist/bundle.js

cp example/index.prod.html example/dist/index.html
cp example/*.css example/dist
cp -R example/fonts example/dist
cp -R example/img example/dist
cp -R example/swagger-files example/dist
9 changes: 0 additions & 9 deletions docs/index.html

This file was deleted.

23 changes: 23 additions & 0 deletions example/index.prod.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>api-explorer</title>
<link rel="stylesheet" type="text/css" href="bundle-hub2.css">
<link rel="stylesheet" type="text/css" href="hub-custom.css">
<style type="text/css">
.api-list-header {
padding-left: 30px;
}
/* Removing sidebar padding */
section#hub-content {
padding-left: 0;
}
</style>
</head>
<body>
<section id="hub-content">
<div id="hub-reference"></div>
</section>
<script src="bundle.js"></script>
</body>
</html>
Loading

0 comments on commit 89fde7e

Please sign in to comment.