Skip to content

Commit

Permalink
Upgrade to webpack v4
Browse files Browse the repository at this point in the history
  -  Delete .babelrc
  - Update .eslintrc
  - Update some webpack dependencies
  - Update configs for webpack and electron
  - Remove hot loader
  • Loading branch information
davidsmorais committed Mar 28, 2019
1 parent 968f807 commit 65592f4
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 36 deletions.
8 changes: 0 additions & 8 deletions .babelrc

This file was deleted.

1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true
Expand Down
5 changes: 1 addition & 4 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable */
import React from 'react';
import ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import registerServiceWorker from './config/registerServiceWorker';
import Root from './config/Root';
import { Provider } from 'react-redux';
Expand All @@ -12,11 +11,9 @@ let MdynaStore = store;
const render = Component => {
store.getState();
ReactDOM.render(
<AppContainer>
<Provider store={MdynaStore}>
<Component />
</Provider>
</AppContainer>,
</Provider>,
document.getElementById('root'),
);
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"react-hot-loader": "^3.0.0-beta.6",
"sass-loader": "^6.0.6",
"style-loader": "^0.18.1",
"url-loader": "0.5.8",
"url-loader": "^1.1.2",
"webpack": "3.3.0",
"webpack-dev-server": "2.8.2"
},
Expand Down
1 change: 0 additions & 1 deletion webpack.config.electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const webpackConfig = merge.smart(baseConfig, {
},
}),
],
target: 'electron',
});

module.exports = webpackConfig;
16 changes: 7 additions & 9 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

const HtmlWebpackPlugin = require('html-webpack-plugin');

const port = process.env.PORT || '8080';
module.exports = {
entry: ['react-hot-loader/patch', './app/index.js', './app/style.scss', '@babel/polyfill'],
entry: ['./app/index.js', './app/style.scss', '@babel/polyfill'],
output: {
filename: 'index.js',
publicPath: process.env.NODE_ENV === 'PROD' ? './' : `http://localhost:${port}/dist/web`,
Expand All @@ -27,11 +27,11 @@ module.exports = {
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
loader:
'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass-loader',
}),
use: [
'style-loader', // creates style nodes from JS strings
'css-loader', // translates CSS into CommonJS
'sass-loader', // compiles Sass to CSS, using Node Sass by default
],
},
{
test: /.jsx?$/,
Expand All @@ -41,7 +41,6 @@ module.exports = {
presets: ['@babel/react', '@babel/preset-env'],
plugins: [
'@babel/plugin-proposal-optional-chaining',
'react-hot-loader/babel',
'@babel/plugin-proposal-class-properties',
],
},
Expand Down Expand Up @@ -75,7 +74,6 @@ module.exports = {
],
},
plugins: [
new ExtractTextPlugin({ filename: 'style/style.css', disable: false, allChunks: true }),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
Expand Down
34 changes: 22 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,11 @@ acorn@^5.0.0, acorn@^5.5.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279"
integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==

ajv-errors@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d"
integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==

ajv-keywords@^2.0.0, ajv-keywords@^2.1.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762"
Expand Down Expand Up @@ -5919,11 +5924,6 @@ mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.19:
dependencies:
mime-db "~1.37.0"

[email protected]:
version "1.3.6"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.6.tgz#591d84d3653a6b0b4a3b9df8de5aa8108e72e5e0"
integrity sha1-WR2E02U6awtKO5343lqoEI5y5eA=

[email protected]:
version "1.4.1"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
Expand All @@ -5934,7 +5934,7 @@ mime@^1.3.4, mime@^1.5.0:
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==

mime@^2.4.0:
mime@^2.0.3, mime@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6"
integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==
Expand Down Expand Up @@ -8392,6 +8392,15 @@ schema-utils@^0.4.0:
ajv "^6.1.0"
ajv-keywords "^3.1.0"

schema-utils@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770"
integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==
dependencies:
ajv "^6.1.0"
ajv-errors "^1.0.0"
ajv-keywords "^3.1.0"

scss-tokenizer@^0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1"
Expand Down Expand Up @@ -9511,13 +9520,14 @@ urix@^0.1.0:
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=

url-loader@0.5.8:
version "0.5.8"
resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-0.5.8.tgz#b9183b1801e0f847718673673040bc9dc1c715c5"
integrity sha1-uRg7GAHg+EdxhnNnMEC8ncHHFcU=
url-loader@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-1.1.2.tgz#b971d191b83af693c5e3fea4064be9e1f2d7f8d8"
integrity sha512-dXHkKmw8FhPqu8asTc1puBfe3TehOCo2+RmOOev5suNCIYBcT626kxiWg1NBVkwc4rO8BGa7gP70W7VXuqHrjg==
dependencies:
loader-utils "^1.0.2"
mime "1.3.x"
loader-utils "^1.1.0"
mime "^2.0.3"
schema-utils "^1.0.0"

url-parse-lax@^1.0.0:
version "1.0.0"
Expand Down

0 comments on commit 65592f4

Please sign in to comment.