Skip to content

Commit

Permalink
minify and package for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkly committed Feb 28, 2016
1 parent 6c71f42 commit 7d61d27
Show file tree
Hide file tree
Showing 9 changed files with 205 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ jspm_packages
.node_repl_history
# ===== End Node.gitignore =====

# Store
store
50 changes: 50 additions & 0 deletions dist/bundle.min.js

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions dist/css/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
body {
background: #fff;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 15px;
line-height: 1.7;
margin: 0;
padding: 30px;
min-width: 320px;
box-sizing: border-box;
}

a {
color: #4183c4;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

h1, h2, h3, h4 {
font-weight: bold;
margin: 15px 0 0;
padding: 0;
}

h1 {
border-bottom: 1px solid #ddd;
font-size: 2em;
font-weight: bold;
margin: 0 0 15px;
padding: 0;
}

h2 {
border-bottom: 1px solid #eee;
font-size: 1.5em;
}

h3 {
font-size: 1.2em;
}

h4 {
font-size: 1em;
}

p, ul {
margin: 0;
}

ul {
padding-left: 30px;
}

button,
input {
font-size: 13px;
}

.itemList,
.controls {
display: inline-block;
vertical-align: top;
}

.itemList {
margin-right: 5em;
min-width: 200px;
width: auto;
}

.controls {
min-width: 48%;
}

input[type="text"] {
font-size: 1.1em;
margin-right: 4px;
padding: 10px;
}

select,
input[type="submit"] {
font-size: 1.2em;
}

.item.expired {
color: gray;
font-style: italic;
}

.item.expired .itemExpiration {
color: red;
}

/* media queries */
@media (max-width: 570px) {
.itemList,
.controls {
display: block;
vertical-align: top;
width: 100%;
}
}
Binary file added dist/favicon.ico
Binary file not shown.
13 changes: 13 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Inventory Demo</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.2/toastr.min.css">
<link rel="stylesheet" href="css/base.css" />
</head>
<body>
<div id="content"></div>
<script src="bundle.min.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"start": "webpack-dev-server --inline",
"server": "DEV=true nodemon server --ignore public/ --ignore store/",
"test": "mocha './tests/**/*.spec.js' --compilers js:babel-core/register",
"testwatch": "clear && mocha './tests/**/*.spec.js' --compilers js:babel-core/register --watch"
"testwatch": "clear && mocha './tests/**/*.spec.js' --compilers js:babel-core/register --watch",
"deploy": "NODE_ENV=production webpack -p --config webpack.prod.config.js"
},
"author": "jbkly",
"license": "MIT",
Expand All @@ -17,7 +18,6 @@
"hapi-swagger": "^4.2.1",
"humanize-duration": "^3.6.1",
"inert": "^3.2.0",
"joi": "^8.0.2",
"jquery": "^2.2.1",
"react": "^0.14.7",
"react-dom": "^0.14.7",
Expand Down
22 changes: 0 additions & 22 deletions store/items.json

This file was deleted.

1 change: 0 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var webpack = require('webpack');
var path = require('path');

module.exports = {
Expand Down
33 changes: 33 additions & 0 deletions webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
var path = require('path');
var node_modules = path.resolve(__dirname, 'node_modules');
var reactMinified = path.resolve(node_modules, 'react/dist/react.min.js');
var reactDOMMinified = path.resolve(node_modules, 'react-dom/dist/react-dom.min.js');

module.exports = {
entry: './public/js/app.jsx',
resolve: {
extensions: ['','.js','.jsx'],
// alias: {
// 'react': reactMinified,
// 'react-dom': reactDOMMinified
// }
},
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: [node_modules],
loader: 'babel',
query: {
presets: ['react','es2015']
}
}
],
// noParse: [reactMinified]
}
};

0 comments on commit 7d61d27

Please sign in to comment.