Skip to content

TagSpaces is an offline, open source, document manager with tagging support

improving pwa support

Ilian Sapundshievfded3c970838
diff --git a/app/components/dialogs/GenericDialog.js b/app/components/dialogs/GenericDialog.js
index 1f0e667fb..2acad01b7 100644
--- a/app/components/dialogs/GenericDialog.js
+++ b/app/components/dialogs/GenericDialog.js
@@ -31,9 +31,9 @@ type Props = {
onClose: () => void,
onBackdropClick?: () => void,
onEnterKey?: () => void,
- renderTitle: () => Object,
+ renderTitle?: () => Object,
renderContent: () => Object,
- renderActions: () => Object
+ renderActions?: () => Object
};
export function onEnterKeyHandler(event: any, confirmFunction: () => void) {
diff --git a/app/components/dialogs/OnboardingDialog.js b/app/components/dialogs/OnboardingDialog.js
index d798cdf65..331ac4cc8 100644
--- a/app/components/dialogs/OnboardingDialog.js
+++ b/app/components/dialogs/OnboardingDialog.js
@@ -31,11 +31,10 @@ import RadioGroup from '@material-ui/core/RadioGroup';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import FormControl from '@material-ui/core/FormControl';
import withMobileDialog from '@material-ui/core/withMobileDialog';
-import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
import ToggleButton from '@material-ui/lab/ToggleButton';
import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
import MobileStepper from '@material-ui/core/MobileStepper';
-// import WelcomeImage from '../../assets/images/onboarding.jpg';
+import GenericDialog from './GenericDialog';
import NavigationV3 from '../../assets/images/navigation-v3.png';
import BrowserExtension from '../../assets/images/collecting-undraw.svg';
import WizardFinished from '../../assets/images/balloons-undraw.svg';
@@ -105,7 +104,7 @@ class OnboardingDialog extends React.Component<Props, State> {
const { activeStep } = this.state;
return (
- <DialogContent style={{ marginTop: 20, overflowY: 'overlay' }}>
+ <DialogContent style={{ marginTop: 20 }}>
<SwipeableViews
index={activeStep}
onChangeIndex={this.handleStepChange}
@@ -118,13 +117,12 @@ class OnboardingDialog extends React.Component<Props, State> {
>
<Typography variant="h5">Welcome to TagSpaces</Typography>
<Typography variant="h6">&nbsp;</Typography>
- {/* <Typography variant="h6">Your favorite file organizer has a fresh new look</Typography> */}
<img
- style={{ maxHeight: 340, marginTop: 15 }}
+ style={{ maxHeight: 300, marginTop: 15 }}
src={NewLook}
alt=""
/>
- <Typography variant="h6">Try our user interface themes</Typography>
+ <Typography variant="h6">Try our interface themes</Typography>
<Typography variant="h6">&nbsp;</Typography>
<ToggleButtonGroup
value={this.props.currentTheme}
@@ -147,7 +145,7 @@ class OnboardingDialog extends React.Component<Props, State> {
>
<Typography variant="h5">Understand main app navigation</Typography>
<img
- style={{ marginTop: 15, maxHeight: 500 }}
+ style={{ marginTop: 15, maxHeight: 500 }}
src={NavigationV3}
alt=""
/>
@@ -215,7 +213,7 @@ class OnboardingDialog extends React.Component<Props, State> {
>
<Typography variant="h5">Collect web content in Chrome and Firefox</Typography>
<img
- style={{ maxHeight: 400, marginTop: 15 }}
+ style={{ maxHeight: 300, marginTop: 15 }}
src={BrowserExtension}
alt=""
/>
@@ -248,63 +246,50 @@ class OnboardingDialog extends React.Component<Props, State> {
</Typography>
</div>
</SwipeableViews>
- <MobileStepper
- style={{ marginTop: 10, backgroundColor: 'transparent' }}
- steps={this.maxSteps}
- position="static"
- activeStep={activeStep}
- nextButton={
- (activeStep === this.maxSteps - 1) ? (
- <Button
- size="small"
- onClick={this.props.onClose}
- variant="contained"
- color="primary"
- data-tid="startTagSpacesAfterOnboarding"
- >
- Start using TagSpaces
- </Button>
+ </DialogContent>
+ );
+ };
- ) : (
- <Button
- size="small"
- onClick={this.handleNext}
- data-tid="nextStepOnboarding"
- >
- {i18n.t('core:next')}
- </Button>
- )
- }
- backButton={
+ renderActions = () => (
+ <DialogActions style={{ justifyContent: 'center' }}>
+ <MobileStepper
+ style={{ marginTop: 10, backgroundColor: 'transparent' }}
+ steps={this.maxSteps}
+ position="static"
+ activeStep={this.state.activeStep}
+ nextButton={
+ (this.state.activeStep === this.maxSteps - 1) ? (
<Button
size="small"
- onClick={this.handleBack}
- disabled={activeStep === 0}
- >
- {i18n.t('core:prev')}
+ onClick={this.props.onClose}
+ variant="contained"
+ color="primary"
+ data-tid="startTagSpacesAfterOnboarding"
+ >Start using TagSpaces
</Button>
- }
- />
- </DialogContent>
- );
- };
- // renderActions = () => (
- // <DialogActions style={{ justifyContent: 'center' }}>
- // <Button
- // data-tid="startTagSpacesAfterOnboarding"
- // onClick={this.props.onClose}
- // variant={
- // this.state.activeStep === this.maxSteps - 1 ? 'contained' : 'text'
- // }
- // color="primary"
- // >
- // {this.state.activeStep === this.maxSteps - 1
- // ? 'Start using TagSpaces'
- // : i18n.t('core:closeButton')}
- // </Button>
- // </DialogActions>
- // );
+ ) : (
+ <Button
+ size="small"
+ onClick={this.handleNext}
+ data-tid="nextStepOnboarding"
+ >
+ {i18n.t('core:next')}
+ </Button>
+ )
+ }
+ backButton={
+ <Button
+ size="small"
+ onClick={this.handleBack}
+ disabled={this.state.activeStep === 0}
+ >
+ {i18n.t('core:prev')}
+ </Button>
+ }
+ />
+ </DialogActions>
+ );
render() {
const { fullScreen, open, onClose } = this.props;
@@ -314,6 +299,7 @@ class OnboardingDialog extends React.Component<Props, State> {
open={open}
onClose={onClose}
renderContent={this.renderContent}
+ renderActions={this.renderActions}
/>
);
}
diff --git a/scripts/webserver.js b/scripts/webserver.js
index 550529a4d..9c3131f77 100644
--- a/scripts/webserver.js
+++ b/scripts/webserver.js
@@ -1,8 +1,8 @@
-var express = require('express')
-var serveStatic = require('serve-static')
-const port = 8000
-var app = express()
+var express = require('express');
+var serveStatic = require('serve-static');
+const port = 8000;
+var app = express();
-app.use(serveStatic('./web', { 'index': ['index.html'] }))
-app.listen(port)
-console.log('Webserver listining on http://127.0.0.1:' + port)
+app.use(serveStatic('./web', { 'index': ['index.html'] }));
+app.listen(port);
+console.log('Webserver listining on http://127.0.0.1:' + port);
diff --git a/web/index.html b/web/index.html
index 2b66b5671..e672921f9 100644
--- a/web/index.html
+++ b/web/index.html
@@ -1,44 +1,66 @@
<!DOCTYPE html>
<html>
- <head>
- <title>TagSpaces Web</title>
- <meta http-equiv="Content-Security-Policy" content="connect-src *; default-src 'self' ; script-src 'self' ; style-src 'self' 'unsafe-inline' data: blob: ; media-src *; img-src * data: content:;">
- <meta name="format-detection" content="telephone=no">
- <meta name="msapplication-tap-highlight" content="no">
- <meta charset="utf-8">
- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
- <meta name="theme-color" content="#1DD19F">
- <meta name="description" content="PWA for TagSpaces Application">
- <link rel="icon" sizes="192x192" href="/node_modules/@tagspaces/pro/assets/icons/192x192.png" />
- <link rel="apple-touch-icon" href="/node_modules/@tagspaces/pro/assets/icons/192x192.png" />
- <link rel="stylesheet" type="text/css" href="dist/style.css">
- <link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
- <script type="text/javascript" src="extconfig.js"></script>
- </head>
- <body style="overflow: hidden; margin: 0; padding: 0;">
- <div id="root">
- <div style="text-align: center; width: 100%; height: 100%; font-size: 1.4em; position:absolute; z-index: 999999; background-color: #F5F5F5; user-select: none; -webkit-user-select: none; -moz-user-select: none; -webkit-app-region: drag" class="appBackgroundTile">
- <div style="top:45%; width: 100%; text-align: center; position:absolute;">
- <svg style="vertical-align: middle" xmlns="http://www.w3.org/2000/svg" version="1.1" width="100" height="100">
- <g id="layer1" transform="matrix(0.33346217,0,0,0.33346217,-0.01300084,-250.91)">
- <rect style="fill:none;fill-opacity:1;stroke:none" id="rect3052-8-1" width="299.42227" height="299.42227" x="-0.019505024" y="752.95935" />
- <path style="fill:#ffffff;fill-opacity:1;stroke:none" d="m 181.90177,787.75394 70.88695,43.53834 C 180.29225,977.67059 187.41436,950.59754 124.58989,989.154 L 65.05006,905.90077 Z" id="rect3052-8-2-2" />
- <ellipse style="fill:#616577;fill-opacity:1;stroke:none" id="path4875-4-7-5-6-2" cx="192.4187" cy="851.11481" rx="15.970615" ry="15.782593" />
- <path style="fill:none;stroke:#a466aa;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 159.73623,964.91671 134.54529,941.61879" id="path3108-5-39-8" />
- <path style="fill:none;stroke:#ffffff;stroke-width:34.19813538;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 162.16161,795.17204 90.03628,0.34544 0,86.1724 -115.50748,117.79375 -88.457192,-81.6665 z" id="path3923-1-1-4-9-8" />
- <path style="fill:#f7901e;fill-opacity:1;stroke:#33b5be;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 204.81469,910.87834 -50.38182,-45.3016" id="path3108-9-1-76-7" />
- <path style="fill:#616577;fill-opacity:1;stroke:#f7901e;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 182.93838,938.7066 144.48907,904.40668" id="path3108-0-7-9-8" />
- <path style="fill:none;stroke:#616577;stroke-width:31.96374702;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 164.34385,800.70161 83.03644,0 0,79.10209 -110.49206,113.42316 -82.031957,-75.83333 z" id="path3923-1-1-4-9" />
- </g>
- </svg>
- </div>
+
+<head>
+ <title>TagSpaces Web</title>
+ <meta http-equiv="Content-Security-Policy"
+ content="connect-src *; default-src 'self' ; script-src 'self' ; style-src 'self' 'unsafe-inline' data: blob: ; media-src *; img-src * data: content:;">
+ <meta name="format-detection" content="telephone=no">
+ <meta name="msapplication-tap-highlight" content="no">
+ <meta charset="utf-8">
+ <meta name="viewport"
+ content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
+ <meta name="theme-color" content="#1DD19F">
+ <meta name="description" content="PWA for TagSpaces Pro">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-status-bar-style" content="black">
+ <meta name="apple-mobile-web-app-title" content="TagSpaces PRO PWA">
+ <link rel="icon" sizes="192x192" href="/node_modules/@tagspaces/pro/assets/icons/192x192.png" />
+ <link rel="apple-touch-icon" href="/node_modules/@tagspaces/pro/assets/icons/192x192.png" />
+ <link rel="stylesheet" type="text/css" href="dist/style.css">
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials">
+ <script type="text/javascript" src="extconfig.js"></script>
+ <script type="text/javascript" src="pwa.js"></script>
+</head>
+
+<body style="overflow: hidden; margin: 0; padding: 0;">
+ <div id="root">
+ <div
+ style="text-align: center; width: 100%; height: 100%; font-size: 1.4em; position:absolute; z-index: 999999; background-color: #F5F5F5; user-select: none; -webkit-user-select: none; -moz-user-select: none; -webkit-app-region: drag"
+ class="appBackgroundTile">
+ <div style="top:45%; width: 100%; text-align: center; position:absolute;">
+ <svg style="vertical-align: middle" xmlns="http://www.w3.org/2000/svg" version="1.1" width="100" height="100">
+ <g id="layer1" transform="matrix(0.33346217,0,0,0.33346217,-0.01300084,-250.91)">
+ <rect style="fill:none;fill-opacity:1;stroke:none" id="rect3052-8-1" width="299.42227" height="299.42227"
+ x="-0.019505024" y="752.95935" />
+ <path style="fill:#ffffff;fill-opacity:1;stroke:none"
+ d="m 181.90177,787.75394 70.88695,43.53834 C 180.29225,977.67059 187.41436,950.59754 124.58989,989.154 L 65.05006,905.90077 Z"
+ id="rect3052-8-2-2" />
+ <ellipse style="fill:#616577;fill-opacity:1;stroke:none" id="path4875-4-7-5-6-2" cx="192.4187"
+ cy="851.11481" rx="15.970615" ry="15.782593" />
+ <path
+ style="fill:none;stroke:#a466aa;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 159.73623,964.91671 134.54529,941.61879" id="path3108-5-39-8" />
+ <path
+ style="fill:none;stroke:#ffffff;stroke-width:34.19813538;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 162.16161,795.17204 90.03628,0.34544 0,86.1724 -115.50748,117.79375 -88.457192,-81.6665 z"
+ id="path3923-1-1-4-9-8" />
+ <path
+ style="fill:#f7901e;fill-opacity:1;stroke:#33b5be;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 204.81469,910.87834 -50.38182,-45.3016" id="path3108-9-1-76-7" />
+ <path
+ style="fill:#616577;fill-opacity:1;stroke:#f7901e;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 182.93838,938.7066 144.48907,904.40668" id="path3108-0-7-9-8" />
+ <path
+ style="fill:none;stroke:#616577;stroke-width:31.96374702;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 164.34385,800.70161 83.03644,0 0,79.10209 -110.49206,113.42316 -82.031957,-75.83333 z"
+ id="path3923-1-1-4-9" />
+ </g>
+ </svg>
</div>
</div>
- <script type="text/javascript" src="dist/bundle.js"></script>
- </body>
+ </div>
+ <script type="text/javascript" src="dist/bundle.js"></script>
+</body>
+
</html>
diff --git a/web/offline.html b/web/offline.html
new file mode 100644
index 000000000..c3f4b79d4
--- /dev/null
+++ b/web/offline.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>TagSpaces Web Offline</title>
+ <meta http-equiv="Content-Security-Policy" content="connect-src *; default-src 'self' ; script-src 'self' ; style-src 'self' 'unsafe-inline' data: blob: ; media-src *; img-src * data: content:;">
+ <meta name="format-detection" content="telephone=no">
+ <meta name="msapplication-tap-highlight" content="no">
+ <meta charset="utf-8">
+ <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
+ <meta name="theme-color" content="#1DD19F">
+ <meta name="description" content="PWA for TagSpaces Application">
+ <link rel="icon" sizes="192x192" href="/node_modules/@tagspaces/pro/assets/icons/192x192.png" />
+ <link rel="apple-touch-icon" href="/node_modules/@tagspaces/pro/assets/icons/192x192.png" />
+ <link rel="stylesheet" type="text/css" href="dist/style.css">
+ </head>
+ <body style="overflow: hidden; margin: 0; padding: 0;">
+ <div id="root">
+ <div style="text-align: center; width: 100%; height: 100%; position:absolute; z-index: 999999; background-color: #F5F5F5; user-select: none; -webkit-user-select: none; -moz-user-select: none; -webkit-app-region: drag" class="appBackgroundTile">
+ <div style="font-size: 1em; padding-top: 30px; padding-left: 10px; padding-right: 30px;">You appear to be offline. TagSpaces requires an internet connection.</div>
+ <div style="top:45%; width: 100%; text-align: center; position:absolute;">
+ <svg style="vertical-align: middle" xmlns="http://www.w3.org/2000/svg" version="1.1" width="100" height="100">
+ <g id="layer1" transform="matrix(0.33346217,0,0,0.33346217,-0.01300084,-250.91)">
+ <rect style="fill:none;fill-opacity:1;stroke:none" id="rect3052-8-1" width="299.42227" height="299.42227" x="-0.019505024" y="752.95935" />
+ <path style="fill:#ffffff;fill-opacity:1;stroke:none" d="m 181.90177,787.75394 70.88695,43.53834 C 180.29225,977.67059 187.41436,950.59754 124.58989,989.154 L 65.05006,905.90077 Z" id="rect3052-8-2-2" />
+ <ellipse style="fill:#616577;fill-opacity:1;stroke:none" id="path4875-4-7-5-6-2" cx="192.4187" cy="851.11481" rx="15.970615" ry="15.782593" />
+ <path style="fill:none;stroke:#a466aa;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 159.73623,964.91671 134.54529,941.61879" id="path3108-5-39-8" />
+ <path style="fill:none;stroke:#ffffff;stroke-width:34.19813538;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 162.16161,795.17204 90.03628,0.34544 0,86.1724 -115.50748,117.79375 -88.457192,-81.6665 z" id="path3923-1-1-4-9-8" />
+ <path style="fill:#f7901e;fill-opacity:1;stroke:#33b5be;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 204.81469,910.87834 -50.38182,-45.3016" id="path3108-9-1-76-7" />
+ <path style="fill:#616577;fill-opacity:1;stroke:#f7901e;stroke-width:27.50978279;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 182.93838,938.7066 144.48907,904.40668" id="path3108-0-7-9-8" />
+ <path style="fill:none;stroke:#616577;stroke-width:31.96374702;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 164.34385,800.70161 83.03644,0 0,79.10209 -110.49206,113.42316 -82.031957,-75.83333 z" id="path3923-1-1-4-9" />
+ </g>
+ </svg>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/web/pwa.js b/web/pwa.js
new file mode 100644
index 000000000..f50757662
--- /dev/null
+++ b/web/pwa.js
@@ -0,0 +1,9 @@
+'use strict';
+if ('serviceWorker' in navigator) {
+ window.addEventListener('load', () => {
+ navigator.serviceWorker.register('/service-worker.js').then((reg) => {
+ // console.log('TagSpaces service worker registered.', reg);
+ return true;
+ }).catch(err => console.warn('Error registering TagSpaces service worker ' + err));
+ });
+}
diff --git a/web/service-worker.js b/web/service-worker.js
new file mode 100644
index 000000000..6ddcf8fbe
--- /dev/null
+++ b/web/service-worker.js
@@ -0,0 +1,66 @@
+'use strict';
+
+const CACHE_NAME = 'TAGSPACES_VERSION';
+
+const FILES_TO_CACHE = [
+ 'dist/bundle.js',
+ 'dist/style.css',
+ 'dist/roboto-v18-cyrillic_latin-100.ttf',
+ 'dist/roboto-v18-cyrillic_latin-100.woff',
+ 'dist/roboto-v18-cyrillic_latin-100.woff2',
+ 'dist/roboto-v18-cyrillic_latin-300.ttf',
+ 'dist/roboto-v18-cyrillic_latin-300.woff',
+ 'dist/roboto-v18-cyrillic_latin-300.woff2',
+ 'dist/roboto-v18-cyrillic_latin-500.ttf',
+ 'dist/roboto-v18-cyrillic_latin-500.woff',
+ 'dist/roboto-v18-cyrillic_latin-500.woff2',
+ 'dist/roboto-v18-cyrillic_latin-700.ttf',
+ 'dist/roboto-v18-cyrillic_latin-700.woff',
+ 'dist/roboto-v18-cyrillic_latin-700.woff2',
+ 'dist/roboto-v18-cyrillic_latin-900.ttf',
+ 'dist/roboto-v18-cyrillic_latin-900.woff',
+ 'dist/roboto-v18-cyrillic_latin-900.woff2',
+ 'dist/roboto-v18-cyrillic_latin-regular.ttf',
+ 'dist/roboto-v18-cyrillic_latin-regular.woff',
+ 'dist/roboto-v18-cyrillic_latin-regular.woff2',
+];
+
+self.addEventListener('install', (evt) => {
+ // console.log('[ServiceWorker] Install');
+ caches.open(CACHE_NAME).then((cache) => {
+ console.log('[ServiceWorker] Pre-caching offline page');
+ return cache.addAll(FILES_TO_CACHE);
+ }).catch(err => console.warn('Error opening cache ' + err))
+ self.skipWaiting();
+});
+
+self.addEventListener('activate', (evt) => {
+ // console.log('[ServiceWorker] Activate');
+ evt.waitUntil(
+ caches.keys().then((keyList) => {
+ return Promise.all(keyList.map((key) => {
+ if (key !== CACHE_NAME) {
+ console.log('[ServiceWorker] Removing old cache', key);
+ return caches.delete(key);
+ }
+ }));
+ })
+ );
+ self.clients.claim();
+});
+
+self.addEventListener('fetch', (evt) => {
+ // console.log('[ServiceWorker] Fetch', evt.request.url);
+ if (evt.request.mode !== 'navigate') {
+ return;
+ }
+ evt.respondWith(
+ fetch(evt.request)
+ .catch(() => {
+ return caches.open(CACHE_NAME)
+ .then((cache) => {
+ return cache.match('offline.html');
+ });
+ })
+ );
+});
diff --git a/webpack.config.renderer.web.js b/webpack.config.renderer.web.js
index 992f20807..952d6d889 100644
--- a/webpack.config.renderer.web.js
+++ b/webpack.config.renderer.web.js
@@ -120,6 +120,7 @@ export default merge.smart(baseConfig, {
use: [{
loader: 'file-loader',
options: {
+ name: '[name].[ext]',
publicPath: '../dist/',
}
}]