From 4359c358bd434d1d0b182a13a743881ee21e7d27 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Mon, 11 Jan 2021 11:22:43 +0000 Subject: [PATCH] dist: support run in curdir As https://cli.vuejs.org/config/#vue-config-js said: ``` By default, Vue CLI assumes your app will be deployed at the root of a domain, e.g. https://www.my-app.com/. If your app is deployed at a sub-path, you will need to specify that sub-path using this option. For example, if your app is deployed at https://www.foobar.com/my-app/, set publicPath to '/my-app/'. The value can also be set to an empty string ('') or a relative path (./) so that all assets are linked using relative paths. This allows the built bundle to be deployed under any public path, or used in a file system based environment like a Cordova hybrid app. ``` Reference: - CareyWang/sub-web#38 - CareyWang/sub-web#43 Signed-off-by: CN_SZTL --- src/router/index.js | 2 +- vue.config.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) --- a/src/router/index.js +++ b/src/router/index.js @@ -5,7 +5,7 @@ Vue.use(VueRouter); const routes = [ { - path: "/", + path: "*", name: "SubConverter", component: () => import("../views/Subconverter.vue") } --- a/vue.config.js +++ b/vue.config.js @@ -5,6 +5,7 @@ function resolve(dir) { } module.exports = { + publicPath: '', css: { loaderOptions: { less: {