Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #6

Merged
merged 2 commits into from
Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{
"presets" : [
"latest"
]
}
"presets": [
"env"
],
"env": {
"production": {
"presets": [
["env", {
"es2015": {
"modules": false
}
}]
]
}
}
}
66 changes: 33 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,42 @@
"author": "Cory House",
"license": "MIT",
"dependencies": {
"whatwg-fetch": "1.0.0"
"whatwg-fetch": "2.0.3"
},
"devDependencies": {
"babel-cli": "6.16.0",
"babel-core": "6.17.0",
"babel-loader": "6.2.5",
"babel-preset-latest": "6.16.0",
"babel-register": "6.16.3",
"chai": "3.5.0",
"chalk": "1.1.3",
"cheerio": "0.22.0",
"compression": "1.6.2",
"cross-env": "3.1.3",
"css-loader": "0.25.0",
"eslint": "3.8.1",
"eslint-plugin-import": "2.0.1",
"eslint-watch": "2.1.14",
"express": "4.14.0",
"extract-text-webpack-plugin": "1.0.1",
"html-webpack-plugin": "2.22.0",
"jsdom": "9.8.0",
"json-schema-faker": "0.3.6",
"json-server": "0.8.22",
"localtunnel": "1.8.1",
"mocha": "3.1.2",
"nock": "8.1.0",
"npm-run-all": "3.1.1",
"nsp": "2.6.2",
"numeral": "1.5.3",
"babel-cli": "6.26.0",
"babel-core": "6.26.0",
"babel-loader": "7.1.2",
"babel-preset-env": "1.6.0",
"babel-register": "6.26.0",
"chai": "4.1.2",
"chalk": "2.1.0",
"cheerio": "1.0.0-rc.2",
"compression": "1.7.1",
"cross-env": "5.0.5",
"css-loader": "0.28.7",
"eslint": "4.8.0",
"eslint-plugin-import": "2.7.0",
"eslint-watch": "3.1.2",
"express": "4.16.2",
"extract-text-webpack-plugin": "3.0.1",
"html-webpack-plugin": "2.30.1",
"jsdom": "9.11.0",
"json-schema-faker": "0.4.0",
"json-server": "0.12.0",
"localtunnel": "1.8.3",
"mocha": "4.0.1",
"nock": "9.0.22",
"npm-run-all": "4.1.1",
"nsp": "2.8.1",
"numeral": "2.0.6",
"open": "0.0.5",
"rimraf": "2.5.4",
"style-loader": "0.13.1",
"surge": "0.18.0",
"webpack": "1.13.2",
"webpack-dev-middleware": "1.8.4",
"webpack-hot-middleware": "2.13.0",
"rimraf": "2.6.2",
"style-loader": "0.19.0",
"surge": "0.19.0",
"webpack": "3.6.0",
"webpack-dev-middleware": "1.12.0",
"webpack-hot-middleware": "2.19.1",
"webpack-md5-hash": "0.0.5"
}
}
2 changes: 1 addition & 1 deletion src/api/baseUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default function getBaseUrl() {

function getQueryStringParameterByName(name, url) {
if(!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
name = name.replace(/[[]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if(!results) return null;
Expand Down
21 changes: 14 additions & 7 deletions webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import webpack from 'webpack';
import path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';

export default {
debug: true,
resolve: {
extensions: ['*', '.js', '.jsx', '.json']
},
devtool: 'inline-source-map',
noInfo: false,
entry: [
path.resolve(__dirname, 'src/index')
],
Expand All @@ -15,16 +17,21 @@ export default {
filename: 'bundle.js'
},
plugins: [
new webpack.LoaderOptionsPlugin({
minimize: false,
debug: true,
noInfo: true // set to false to see a list of every file being bundled.
}),
// Create HTML file that includes reference to bundled JS.
new HtmlWebpackPlugin({
new HtmlWebpackPlugin({
template: 'src/index.html',
inject: true
})
],
module: {
loaders: [
{test: /\.js$/, exclude: /node_modules/, loaders: ['babel']},
{test: /\.css$/, loaders: ['style','css']}
rules: [
{test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'},
{test: /\.css$/, use: ['style-loader','css-loader']}
]
}
}
}
30 changes: 20 additions & 10 deletions webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import path from 'path';
import webpack from 'webpack';
import path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import WebpackMd5Hash from 'webpack-md5-hash';
import ExtractTextPlugin from 'extract-text-webpack-plugin';

export default {
debug: true,
resolve: {
extensions: ['*', '.js', '.jsx', '.json']
},
devtool: 'source-map',
noInfo: false,
entry: {
vendor: path.resolve(__dirname, 'src/vendor'),
main: path.resolve(__dirname, 'src/index')
Expand All @@ -19,17 +20,27 @@ export default {
filename: '[name].[chunkhash].js'
},
plugins: [
// Global loader configuration
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false,
noInfo: true // set to false to see a list of every file being bundled.
}),

// Generate an external css file with a hash in the filename
new ExtractTextPlugin('[name].[contenthash].css'),

// Hash the files using MD5 so that their names change when the content changes.
new WebpackMd5Hash(),

// Use CommonsChunkPlugin to create a separate bundle
// of vendor libraries so that they're cached separately.
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor'
}),

// Create HTML file that includes reference to bundled JS.
new HtmlWebpackPlugin({
new HtmlWebpackPlugin({
template: 'src/index.html',
minify: {
removeComments: true,
Expand All @@ -48,15 +59,14 @@ export default {
// using htmlWebpackPlugin.options.varName
trackJSToken: 'a04ce9b4a6f54171a996364ca786c5c8'
}),
// Eliminate duplicate packages when generating bundle
new webpack.optimize.DedupePlugin(),

// Minify JS
new webpack.optimize.UglifyJsPlugin()
],
module: {
loaders: [
{test: /\.js$/, exclude: /node_modules/, loaders: ['babel']},
{test: /\.css$/, loader: ExtractTextPlugin.extract('css?sourceMap')}
rules: [
{test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'},
{test: /\.css$/, loader: ExtractTextPlugin.extract('css-loader?sourceMap')}
]
}
}
};