aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-11 23:28:25 +0800
committercrupest <crupest@outlook.com>2020-06-11 23:28:25 +0800
commitcab7a278030af214f0503fa705d2015661a9ac4d (patch)
treeed109801378b768f12eb7e22b77d98f48609679a
parent64c4376ed388af106c1de5ec8bd1d1743950a27e (diff)
downloadtimeline-cab7a278030af214f0503fa705d2015661a9ac4d.tar.gz
timeline-cab7a278030af214f0503fa705d2015661a9ac4d.tar.bz2
timeline-cab7a278030af214f0503fa705d2015661a9ac4d.zip
build(front): Not use service worker in development mode.
-rw-r--r--Timeline/ClientApp/src/app/index.tsx2
-rw-r--r--Timeline/ClientApp/webpack.config.dev.js16
-rw-r--r--Timeline/ClientApp/webpack.config.prod.js2
3 files changed, 2 insertions, 18 deletions
diff --git a/Timeline/ClientApp/src/app/index.tsx b/Timeline/ClientApp/src/app/index.tsx
index ff874c45..086bd6e8 100644
--- a/Timeline/ClientApp/src/app/index.tsx
+++ b/Timeline/ClientApp/src/app/index.tsx
@@ -13,5 +13,3 @@ import './i18n';
import App from './App';
ReactDOM.render(<App />, document.getElementById('app'));
-
-import './service-worker';
diff --git a/Timeline/ClientApp/webpack.config.dev.js b/Timeline/ClientApp/webpack.config.dev.js
index 7a38f2b6..c2f29700 100644
--- a/Timeline/ClientApp/webpack.config.dev.js
+++ b/Timeline/ClientApp/webpack.config.dev.js
@@ -2,9 +2,7 @@ const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
-const CopyPlugin = require('copy-webpack-plugin');
const PnpWebpackPlugin = require('pnp-webpack-plugin');
-const WorkboxPlugin = require('workbox-webpack-plugin');
const { commonRules, htmlCommonConfig } = require('./webpack.common');
@@ -55,7 +53,7 @@ const config = {
publicPath: '/',
},
devServer: {
- contentBase: false,
+ contentBase: path.resolve(__dirname, 'public/'),
host: '0.0.0.0',
port: 3000,
publicPath: 'http://localhost:3000/',
@@ -67,14 +65,6 @@ const config = {
...htmlCommonConfig,
devServer: 'http://localhost:3000',
}),
- new CopyPlugin({
- patterns: [
- {
- from: path.resolve(__dirname, 'public/'),
- to: path.resolve(__dirname, 'dist/'),
- },
- ],
- }),
new ForkTsCheckerWebpackPlugin({
tsconfig: './src/app/tsconfig.json',
}),
@@ -82,10 +72,6 @@ const config = {
tsconfig: './src/sw/tsconfig.json',
}),
new webpack.HotModuleReplacementPlugin(),
- new WorkboxPlugin.InjectManifest({
- swSrc: './src/sw/sw.ts',
- maximumFileSizeToCacheInBytes: 15000000,
- }),
],
};
diff --git a/Timeline/ClientApp/webpack.config.prod.js b/Timeline/ClientApp/webpack.config.prod.js
index 3b74faf6..e4594421 100644
--- a/Timeline/ClientApp/webpack.config.prod.js
+++ b/Timeline/ClientApp/webpack.config.prod.js
@@ -9,7 +9,7 @@ const WorkboxPlugin = require('workbox-webpack-plugin');
const { commonRules, htmlCommonConfig } = require('./webpack.common');
const config = {
- entry: ['./src/app/index.tsx'],
+ entry: ['./src/app/index.tsx', './src/app/service-worker.tsx'],
mode: 'production',
devtool: 'source-map',
module: {