From d188435fd8ad5004f2f476af97aceae0ffc01ccd Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Thu, 24 Nov 2016 03:40:22 +0100 Subject: [PATCH] Add Loading splashscreen --- js/src/dapps/index.ejs | 28 +++++++++++++++++++++++++++- js/src/index.ejs | 23 ++++++++++++++++++++++- js/webpack/config.js | 37 ++++++++----------------------------- js/webpack/shared.js | 21 +++++++++++++++++++++ 4 files changed, 78 insertions(+), 31 deletions(-) diff --git a/js/src/dapps/index.ejs b/js/src/dapps/index.ejs index 13d70473f..250194529 100644 --- a/js/src/dapps/index.ejs +++ b/js/src/dapps/index.ejs @@ -5,9 +5,35 @@ <%= htmlWebpackPlugin.options.title %> + -
+
+
+ Loading... +
+
<% if (!htmlWebpackPlugin.options.secure) { %> diff --git a/js/src/index.ejs b/js/src/index.ejs index 8428e39ad..eefc50dbb 100644 --- a/js/src/index.ejs +++ b/js/src/index.ejs @@ -7,12 +7,33 @@ <%= htmlWebpackPlugin.options.title %> -
+
+
+ Loading... +
+
diff --git a/js/webpack/config.js b/js/webpack/config.js index 65a999bb9..77eaceee5 100644 --- a/js/webpack/config.js +++ b/js/webpack/config.js @@ -15,12 +15,8 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -const path = require('path'); -const postcssImport = require('postcss-import'); -const postcssNested = require('postcss-nested'); -const postcssVars = require('postcss-simple-vars'); -const rucksack = require('rucksack-css'); const webpack = require('webpack'); +const path = require('path'); const WebpackErrorNotificationPlugin = require('webpack-error-notification'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); @@ -28,17 +24,11 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); const Shared = require('./shared'); const DAPPS = require('../src/dapps'); -const ENV = process.env.NODE_ENV || 'development'; -const isProd = ENV === 'production'; -const DEST = process.env.BUILD_DEST || '.build'; - const FAVICON = path.resolve(__dirname, '../assets/images/parity-logo-black-no-text.png'); -// dapps -const entry = Shared.dappsEntry; - -// main UI -entry.index = './index.js'; +const DEST = process.env.BUILD_DEST || '.build'; +const ENV = process.env.NODE_ENV || 'development'; +const isProd = ENV === 'production'; module.exports = { debug: !isProd, @@ -46,7 +36,9 @@ module.exports = { devtool: isProd ? '#eval' : '#cheap-module-eval-source-map', context: path.join(__dirname, '../src'), - entry: entry, + entry: Object.assign({}, Shared.dappsEntry, { + index: './index.js' + }), output: { path: path.join(__dirname, '../', DEST), filename: '[name].[hash].js' @@ -113,20 +105,7 @@ module.exports = { attrs: ['img:src', 'link:href'] }, - postcss: [ - postcssImport({ - addDependencyTo: webpack - }), - postcssNested({}), - postcssVars({ - unknown: function (node, name, result) { - node.warn(result, `Unknown variable ${name}`); - } - }), - rucksack({ - autoprefixer: true - }) - ], + postcss: Shared.postcss, plugins: (function () { const plugins = Shared.getPlugins().concat([ diff --git a/js/webpack/shared.js b/js/webpack/shared.js index b5a46a11c..f5ef423b9 100644 --- a/js/webpack/shared.js +++ b/js/webpack/shared.js @@ -17,6 +17,11 @@ const webpack = require('webpack'); const HappyPack = require('happypack'); +const postcssImport = require('postcss-import'); +const postcssNested = require('postcss-nested'); +const postcssVars = require('postcss-simple-vars'); +const rucksack = require('rucksack-css'); + const ENV = process.env.NODE_ENV || 'development'; const isProd = ENV === 'production'; @@ -77,6 +82,21 @@ function getDappsEntry () { }, {}); } +const postcss = [ + postcssImport({ + addDependencyTo: webpack + }), + postcssNested({}), + postcssVars({ + unknown: function (node, name, result) { + node.warn(result, `Unknown variable ${name}`); + } + }), + rucksack({ + autoprefixer: true + }) +]; + const proxies = [ { context: (pathname, req) => { @@ -118,5 +138,6 @@ const proxies = [ module.exports = { getPlugins: getPlugins, dappsEntry: getDappsEntry(), + postcss: postcss, proxies: proxies };