Skip to content

Commit

Permalink
Webpack4 (#80)
Browse files Browse the repository at this point in the history
* bumped dependencies and upgraded to webpack 4
  • Loading branch information
mldangelo committed Mar 15, 2018
1 parent 6aee205 commit 326b630
Show file tree
Hide file tree
Showing 4 changed files with 2,049 additions and 700 deletions.
73 changes: 37 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.1",
"private": true,
"scripts": {
"build": "node -r babel-register ./node_modules/webpack/bin/webpack -p --config ./webpack/webpack.production.config.js --progress --profile --colors && rimraf ./dist && mv ./tmp ./dist",
"build": "node -r babel-register ./node_modules/webpack/bin/webpack --config ./webpack/webpack.production.config.js --progress --profile --colors && rimraf ./dist && mv ./tmp ./dist",
"build-dev": "rimraf ./dist && babel-node ./node_modules/webpack/bin/webpack --config ./webpack/webpack.config.js --progress --profile --colors",
"clean": "rimraf ./dist && rimraf ./tmp",
"deploy": "yarn && npm run build && npm run forever-stop || true && npm run forever-start",
Expand All @@ -16,77 +16,78 @@
"analyze": "babel-node ./node_modules/webpack/bin/webpack --config ./webpack/webpack.production.config.js --json | webpack-bundle-size-analyzer"
},
"dependencies": {
"@octokit/rest": "^14.0.8",
"autoprefixer": "^7.2.5",
"axios": "^0.17.1",
"@octokit/rest": "^15.2.2",
"autoprefixer": "^8.1.0",
"axios": "^0.18.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-loader": "^7.1.4",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-react-inline-elements": "^6.22.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.12",
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"babel-register": "^6.26.0",
"body-parser": "^1.18.2",
"compression": "^1.7.1",
"connect-mongodb-session": "^1.4.0",
"compression": "^1.7.2",
"connect-mongodb-session": "^2.0.1",
"cookie-parser": "^1.4.3",
"css-loader": "^0.28.9",
"dotenv": "^5.0.0",
"express": "^4.16.2",
"css-loader": "^0.28.10",
"dotenv": "^5.0.1",
"express": "^4.16.3",
"express-session": "^1.15.6",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.6",
"extract-text-webpack-plugin": "^4.0.0-alpha.0",
"file-loader": "^1.1.11",
"forever": "^0.15.3",
"html-minify-loader": "^1.3.0",
"html-webpack-plugin": "^2.30.1",
"html-webpack-plugin": "^3.0.6",
"js-cookie": "^2.2.0",
"last.fm.api": "^0.1.3",
"moment": "^2.20.1",
"mongoose": "5.0.2",
"moment": "^2.21.0",
"mongoose": "5.0.10",
"morgan": "^1.9.0",
"node-sass": "^4.7.2",
"nodemon": "^1.14.11",
"normalize.css": "^7.0.0",
"nodemon": "^1.17.2",
"normalize.css": "^8.0.0",
"passport": "^0.4.0",
"passport-google-oauth20": "^1.0.0",
"prop-types": "^15.6.0",
"prop-types": "^15.6.1",
"raw-loader": "^1.0.0-beta.0",
"react": "^16.2.0",
"react-burger-menu": "^2.2.3",
"react-burger-menu": "^2.3.0",
"react-dom": "^16.2.0",
"react-ga": "^2.4.1",
"react-helmet": "^5.2.0",
"react-markdown": "^3.1.4",
"react-markdown": "^3.3.0",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"rimraf": "^2.6.2",
"sass-loader": "^6.0.6",
"script-ext-html-webpack-plugin": "^1.8.8",
"sass-loader": "^6.0.7",
"script-ext-html-webpack-plugin": "^2.0.1",
"stats-webpack-plugin": "^0.6.2",
"strip-loader": "^0.1.2",
"style-loader": "^0.20.1",
"url-loader": "^0.6.2",
"webpack": "^3.10.0",
"webpack-dev-middleware": "^2.0.4",
"webpack-hot-middleware": "^2.21.0"
"style-loader": "^0.20.3",
"url-loader": "^1.0.1",
"webpack": "^4.1.1",
"webpack-dev-middleware": "^3.0.1",
"webpack-hot-middleware": "^2.21.2"
},
"devDependencies": {
"babel-eslint": "^8.2.1",
"babel-eslint": "^8.2.2",
"babel-polyfill": "^6.26.0",
"chai": "^4.1.2",
"chromy": "^0.5.8",
"eslint": "^4.16.0",
"chromy": "^0.5.11",
"eslint": "^4.18.2",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jsx-a11y": "6.0.3",
"eslint-plugin-mocha": "^4.11.0",
"eslint-plugin-react": "^7.6.1",
"mocha": "^5.0.0",
"webpack-bundle-size-analyzer": "^2.7.0"
"eslint-plugin-mocha": "^4.12.1",
"eslint-plugin-react": "^7.7.0",
"mocha": "^5.0.4",
"webpack-bundle-size-analyzer": "^2.7.0",
"webpack-cli": "^2.0.12"
}
}
9 changes: 4 additions & 5 deletions webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ScriptExtHtmlWebpackPlugin from 'script-ext-html-webpack-plugin';

export default {
devtool: 'eval-source-map',
mode: 'development',
entry: [
'webpack-hot-middleware/client?path=//localhost:7999/__webpack_hmr&reload=true',
path.join(__dirname, '../app/entry.js'),
Expand All @@ -28,19 +29,17 @@ export default {
new webpack.NoEmitOnErrorsPlugin(),
],
module: {
loaders: [
rules: [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader',
}, {
},
{
test: /\.md$/,
use: [{
loader: 'raw-loader',
}],
}, {
test: /\.json?$/,
loader: 'json-loader',
}, {
test: /\.css$/,
loader: 'style-loader!css-loader?modules&localIdentName=[name]---[local]---[hash:base64:5]',
Expand Down
21 changes: 3 additions & 18 deletions webpack/webpack.production.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
entry: [
path.join(__dirname, '../app/entry.js'),
],
mode: 'production',
output: {
path: path.join(__dirname, '../tmp/'),
filename: '[name]-[hash].min.js',
Expand All @@ -31,22 +32,9 @@ export default {
}),
new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /en/),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.UglifyJsPlugin({
beautify: false,
comments: false,
compress: {
warnings: false,
drop_console: true,
},
mangle: {
except: ['webpackJsonp', 'exports', 'require'],
screw_ie8: true,
keep_fnames: true,
},
}),
],
module: {
loaders: [
rules: [
{
test: /\.js?$/,
exclude: /node_modules/,
Expand All @@ -56,9 +44,6 @@ export default {
use: [{
loader: 'raw-loader',
}],
}, {
test: /\.json?$/,
loader: 'json-loader',
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract({
Expand All @@ -83,7 +68,7 @@ export default {
loader: 'strip-loader?strip[]=console.log',
}, {
test: /\.html$/,
loader: 'raw-loader!html-minify-loader',
loader: 'raw-loader',
},
],
},
Expand Down
Loading

0 comments on commit 326b630

Please sign in to comment.