From d8891f2c1e0ee255ef44b4086f0a5f179dd4c8a3 Mon Sep 17 00:00:00 2001 From: Adolfo Panizo Date: Wed, 7 Mar 2018 10:14:04 +0100 Subject: [PATCH] Removing react-native support and updating devtool to eval-source-map for dev --- config/webpack.config.dev.js | 18 ++++++++++-------- config/webpack.config.prod.js | 5 ----- contracts/Migrations.sol | 23 ----------------------- contracts/SimpleStorage.sol | 13 ------------- 4 files changed, 10 insertions(+), 49 deletions(-) delete mode 100644 contracts/Migrations.sol delete mode 100644 contracts/SimpleStorage.sol diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index cb0f351e..d54eec8c 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -35,7 +35,7 @@ const postcssPlugins = [ ]; module.exports = { - devtool: 'cheap-module-source-map', + devtool: 'eval-source-map', mode: 'development', entry: [ "babel-polyfill", @@ -64,11 +64,6 @@ module.exports = { // some tools, although we do not recommend using it, see: // https://github.com/facebookincubator/create-react-app/issues/290 extensions: ['.js', '.json', '.jsx'], - alias: { - // Support React Native Web - // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/ - 'react-native': 'react-native-web' - } }, output: { // Next line is not used in dev but WebpackDevServer crashes without it: @@ -117,7 +112,7 @@ module.exports = { use: [ { loader: "html-loader", - options: { minimize: true } + options: { minimize: false } } ] } @@ -129,5 +124,12 @@ module.exports = { }), new webpack.DefinePlugin(env), new webpack.HotModuleReplacementPlugin(), - ] + ], + // Some libraries import Node modules but don't use them in the browser. + // Tell Webpack to provide empty mocks for them so importing them works. + node: { + fs: 'empty', + net: 'empty', + tls: 'empty' + } }; diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 3dadb8a9..25119162 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -106,11 +106,6 @@ module.exports = { // some tools, although we do not recommend using it, see: // https://github.com/facebookincubator/create-react-app/issues/290 extensions: ['.js', '.json', '.jsx'], - alias: { - // Support React Native Web - // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/ - 'react-native': 'react-native-web' - } }, module: { diff --git a/contracts/Migrations.sol b/contracts/Migrations.sol deleted file mode 100644 index eeed7a4e..00000000 --- a/contracts/Migrations.sol +++ /dev/null @@ -1,23 +0,0 @@ -pragma solidity ^0.4.2; - -contract Migrations { - address public owner; - uint public last_completed_migration; - - modifier restricted() { - if (msg.sender == owner) _; - } - - function Migrations() public { - owner = msg.sender; - } - - function setCompleted(uint completed) public restricted { - last_completed_migration = completed; - } - - function upgrade(address new_address) public restricted { - Migrations upgraded = Migrations(new_address); - upgraded.setCompleted(last_completed_migration); - } -} diff --git a/contracts/SimpleStorage.sol b/contracts/SimpleStorage.sol deleted file mode 100644 index 53d88902..00000000 --- a/contracts/SimpleStorage.sol +++ /dev/null @@ -1,13 +0,0 @@ -pragma solidity ^0.4.18; - -contract SimpleStorage { - uint storedData; - - function set(uint x) public { - storedData = x; - } - - function get() public view returns (uint) { - return storedData; - } -}