diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..f858204 --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,35 @@ + + +#### Description + + +#### What does this PR do? + + + +#### Description of Task to be completed? + + + + +#### 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 + +- [ ] 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: + + +- [ ] My code follows the code style of this project. +- [ ] My change requires a change to the documentation. +- [ ] I have updated the documentation accordingly. diff --git a/webpack.config.js b/webpack.config.js index ba78156..4b7712c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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 = { @@ -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({ @@ -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: { @@ -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: [ @@ -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: [ @@ -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; diff --git a/webpack.prod.config.js b/webpack.prod.config.js deleted file mode 100644 index 32a1bbd..0000000 --- a/webpack.prod.config.js +++ /dev/null @@ -1,64 +0,0 @@ -import path from 'path'; -import webpack from 'webpack'; -import ExtractTextPlugin from 'extract-text-webpack-plugin'; - -const GLOBALS = { - 'process.env.NODE_ENV': JSON.stringify('production') -}; - -export default { - devtool: 'source-map', - entry: path.resolve(__dirname, 'client/src/index.js'), - resolve: { - extensions: ['.js', '.jsx'] - }, - target: 'web', - output: { - path: `${__dirname}/client/dist`, - publicPath: '/', - filename: 'bundle.js', - }, - devServer: { - contentBase: path.resolve(__dirname, 'dist') - }, - plugins: [ - new webpack.optimize.OccurrenceOrderPlugin(), - new webpack.DefinePlugin(GLOBALS), - new ExtractTextPlugin('styles.css'), - new webpack.optimize.UglifyJsPlugin() - - ], - module: { - loaders: [ - { - test: /(\.css)$/, - use: ExtractTextPlugin.extract({ - use: 'css-loader' - }) - }, - { - test: /\.scss$/, - use: ExtractTextPlugin.extract({ - use: ['css-loader', 'sass-loader'] - }) - }, - { - test: /\.(js|jsx)$/, - loader: 'babel-loader', - exclude: /node_modules/, - query: { - presets: ['es2015', 'react'], - }, - }, - { - test: /\.(woff|woff2)$/, - loader: 'url?prefix=font/&limit=5000' - }, - ], - }, - node: { - dns: 'empty', - net: 'empty', - fs: 'empty' - } -};