diff --git a/.babelrc b/.babelrc index 7222de515..08706fcd8 100644 --- a/.babelrc +++ b/.babelrc @@ -22,7 +22,8 @@ "react-hot-loader/babel", "transform-runtime", "transform-object-rest-spread", - "transform-decorators-legacy" + "transform-decorators-legacy", + "syntax-dynamic-import" ] }, "test": { diff --git a/src/api/web/index.js b/src/api/web/index.js index a7edc496d..316168aee 100644 --- a/src/api/web/index.js +++ b/src/api/web/index.js @@ -43,8 +43,7 @@ module.exports = function(config, auth, storage) { const defaultTitle = 'Verdaccio'; let webPage = template .replace(/ToReplaceByVerdaccio/g, base) - .replace(/ToReplaceByTitle/g, _.get(config, 'web.title') ? config.web.title : defaultTitle) - .replace(/(main.*\.js|style.*\.css)/g, `${base}/-/static/$1`); + .replace(/ToReplaceByTitle/g, _.get(config, 'web.title') ? config.web.title : defaultTitle); res.setHeader('Content-Type', 'text/html'); diff --git a/src/webui/src/router.js b/src/webui/src/router.js index c732eb154..7dbd78662 100644 --- a/src/webui/src/router.js +++ b/src/webui/src/router.js @@ -1,11 +1,13 @@ import React from 'react'; import {HashRouter as Router, Route, Switch} from 'react-router-dom'; +import {asyncComponent} from './utils/asyncComponent'; import Header from './components/Header'; -import Home from './modules/home'; -import Detail from './modules/detail'; import Footer from './components/Footer'; +const DetailPackage = asyncComponent(() => import('./modules/detail')); +const HomePage = asyncComponent(() => import('./modules/home')); + const RouterApp = () => { return ( @@ -13,9 +15,9 @@ const RouterApp = () => {
- - - + + +