Skip to content

Commit

Permalink
chore (Heroku build): Reduced the number of commit messages
Browse files Browse the repository at this point in the history
- Implement, deployed  and created environment on heroku

- Serve client side pages to link server side implementation

- Created a Pull_request_template file to automate pull request

- Refactored package.json to efficiently run scripts

- Ordered test cases to run tests in a specific order
  • Loading branch information
Benny Ogidan authored and Benny Ogidan committed Oct 27, 2017
1 parent 35fb9ad commit fa62d68
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 120 deletions.
35 changes: 35 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--- Provide a general summary of your changes in the Title above -->

#### Description
<!--- Describe your changes in detail -->

#### What does this PR do?
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

#### Description of Task to be completed?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

#### How should this be manually tested?


#### Screenshots (if appropriate):

#### Any background context you want to provide?

#### What are the relevant pivotal tracker stories?

#### Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

#### Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
90 changes: 34 additions & 56 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import webpack from 'webpack';
import path from 'path';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import HtmlPlugin from 'html-webpack-plugin';
const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlPlugin = require('html-webpack-plugin');

const isProd = process.env.NODE_ENV === 'production';
let config = {};

if (isProd) {
const GLOBALS = {
Expand All @@ -28,14 +30,14 @@ if (isProd) {
new ExtractTextPlugin('styles.css'),
new webpack
.optimize
.UglifyJsPlugin({minimize: true}),
new HtmlPlugin({template: './client/src/index.html', filename: './index.html', inject: 'body'})
.UglifyJsPlugin({ minimize: true }),
new HtmlPlugin({ template: './client/src/index.html', filename: './index.html', inject: 'body' })
],
module: {
loaders: [
{
test: /(\.css)$/,
use: ExtractTextPlugin.extract({use: 'css-loader'})
use: ExtractTextPlugin.extract({ use: 'css-loader' })
}, {
test: /\.scss$/,
use: ExtractTextPlugin.extract({
Expand Down Expand Up @@ -71,7 +73,7 @@ if (isProd) {
} else {
const DIST_DIR = path.resolve(__dirname, './client/dist');
const SRC_DIR = path.resolve(__dirname, './client/src');
const extractscss = new ExtractTextPlugin({filename: 'style.css'});
const extractscss = new ExtractTextPlugin({ filename: 'style.css' });
config = {
entry: `${SRC_DIR}/app/index.js`,
output: {
Expand All @@ -81,16 +83,22 @@ if (isProd) {
},
devtool: 'sourcemap',

devServer: {
historyApiFallback: true,
proxy: {
'/api/**': {
target: 'http://localhost:5000/',
secure: false,
changeOrigin: true
devServer: {
historyApiFallback: true,
proxy: {
'/api/**': {
target: 'http://localhost:5000/',
secure: false,
changeOrigin: true
}
}
}
},
},

stats: {

errors: true,
errorDetails: true
},

module: {
loaders: [
Expand All @@ -117,37 +125,16 @@ if (isProd) {
use: ['html-loader']
}, {

module: {
loaders: [
{
test: /\.js?/,
exclude: /node_modules/,
include: SRC_DIR,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015', 'stage-2']
},
}, {
test: /\.(scss|sass)$/,
exclude: /node-modules/,
use: extractscss.extract({
fallback: 'style-loader',
use: ['css-loader', 'sass-loader']
})
}, {
test: /\.html$/,
exclude: /node-modules/,
use: ['html-loader']
}, {
test: /\.(jpg|png)$/,
exclude: /node-modules/,
loader: 'file-loader',
options: {
outputPath: 'img/'
}

test: /\.(jpg|png)$/,
exclude: /node-modules/,
loader: 'file-loader',
options: {
outputPath: 'img/'
}

}
]

},
plugins: [
Expand All @@ -158,15 +145,6 @@ if (isProd) {
new HtmlPlugin({ template: './client/src/index.html', filename: './index.html', inject: 'body' })
]

},
plugins: [
new webpack
.optimize
.OccurrenceOrderPlugin(),
extractscss,
new HtmlPlugin({ template: './client/src/index.html', filename: './index.html', inject: 'body' }),
]

};

};
}
module.exports = config;
64 changes: 0 additions & 64 deletions webpack.prod.config.js

This file was deleted.

0 comments on commit fa62d68

Please sign in to comment.