mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-10 02:55:41 +00:00
Implement offline-plugin
for Service Workers / App Cache (#701)
This commit is contained in:
parent
8452e231d8
commit
ef506c54d6
@ -5,13 +5,15 @@ import 'sass/styles.scss';
|
|||||||
import 'babel-polyfill';
|
import 'babel-polyfill';
|
||||||
import 'whatwg-fetch';
|
import 'whatwg-fetch';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import OfflineRuntime from 'offline-plugin/runtime';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import Root from './Root';
|
import Root from './Root';
|
||||||
import { configuredStore } from './store';
|
import { configuredStore } from './store';
|
||||||
import consoleAdvertisement from './utils/consoleAdvertisement';
|
import consoleAdvertisement from './utils/consoleAdvertisement';
|
||||||
|
|
||||||
const appEl = document.getElementById('app');
|
OfflineRuntime.install();
|
||||||
|
|
||||||
|
const appEl = document.getElementById('app');
|
||||||
render(<Root store={configuredStore} />, appEl);
|
render(<Root store={configuredStore} />, appEl);
|
||||||
|
|
||||||
if (module.hot) {
|
if (module.hot) {
|
||||||
|
@ -93,6 +93,7 @@
|
|||||||
"node-sass": "4.7.2",
|
"node-sass": "4.7.2",
|
||||||
"nodemon": "1.14.7",
|
"nodemon": "1.14.7",
|
||||||
"null-loader": "0.1.1",
|
"null-loader": "0.1.1",
|
||||||
|
"offline-plugin": "4.9.0",
|
||||||
"prettier": "1.9.2",
|
"prettier": "1.9.2",
|
||||||
"progress": "2.0.0",
|
"progress": "2.0.0",
|
||||||
"react-hot-loader": "3.1.3",
|
"react-hot-loader": "3.1.3",
|
||||||
|
@ -6,7 +6,7 @@ const webpack = require('webpack');
|
|||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
|
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
|
||||||
const BabelMinifyPlugin = require('babel-minify-webpack-plugin');
|
const BabelMinifyPlugin = require('babel-minify-webpack-plugin');
|
||||||
// const OfflinePlugin = require('offline-plugin')
|
const OfflinePlugin = require('offline-plugin');
|
||||||
const base = require('./webpack.base');
|
const base = require('./webpack.base');
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
const rimraf = require('rimraf');
|
const rimraf = require('rimraf');
|
||||||
@ -66,15 +66,10 @@ base.plugins.push(
|
|||||||
new webpack.optimize.CommonsChunkPlugin({
|
new webpack.optimize.CommonsChunkPlugin({
|
||||||
name: 'vendor',
|
name: 'vendor',
|
||||||
filename: 'vendor.[chunkhash:8].js'
|
filename: 'vendor.[chunkhash:8].js'
|
||||||
|
}),
|
||||||
|
new OfflinePlugin({
|
||||||
|
appShell: '/'
|
||||||
})
|
})
|
||||||
// For progressive web apps
|
|
||||||
// new OfflinePlugin({
|
|
||||||
// relativePaths: false,
|
|
||||||
// AppCache: false,
|
|
||||||
// ServiceWorker: {
|
|
||||||
// events: true
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// minimize webpack output
|
// minimize webpack output
|
||||||
|
Loading…
x
Reference in New Issue
Block a user