aboutsummaryrefslogtreecommitdiff
path: root/viewer/vue.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/vue.config.js')
-rw-r--r--viewer/vue.config.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/viewer/vue.config.js b/viewer/vue.config.js
index 614f975..f481e4f 100644
--- a/viewer/vue.config.js
+++ b/viewer/vue.config.js
@@ -18,6 +18,7 @@
18*/ 18*/
19 19
20module.exports = { 20module.exports = {
21 publicPath: "./",
21 pluginOptions: { 22 pluginOptions: {
22 i18n: { 23 i18n: {
23 locale: "en", 24 locale: "en",
@@ -26,15 +27,24 @@ module.exports = {
26 enableInSFC: false, 27 enableInSFC: false,
27 }, 28 },
28 }, 29 },
30 chainWebpack: (config) => {
31 config.plugins.delete("prefetch");
32 },
33 configureWebpack: {
34 devtool: "source-map"
35 },
29 productionSourceMap: false, 36 productionSourceMap: false,
30 devServer: { 37 devServer: {
31 port: 8085, 38 port: process.env.VUE_APP_DEVSERVER_PORT,
32 serveIndex: true, 39 serveIndex: true,
33 before: (app, server, compiler) => { 40 before: (app, server, compiler) => {
34 app.get(`${process.env.VUE_APP_DATA_URL}*`, (req, res) => { 41 app.get(`/${process.env.VUE_APP_DATA_URL}*`, (req, res) => {
35 const fs = require("fs"); 42 const fs = require("fs");
36 const fileName = `${process.env.VUE_APP_EXAMPLE_PROJECT}${req.url.slice(process.env.VUE_APP_DATA_URL.length)}`; 43 const url = req.url.slice(process.env.VUE_APP_DATA_URL.length);
37 const file = fs.readFileSync(decodeURIComponent(fileName)); 44 const paramIdx = url.indexOf("?");
45 const filepath = paramIdx < 0 ? url : url.substring(0, paramIdx);
46 const fullpath = `${process.env.VUE_APP_DEVSERVER_CONFIG_PATH}${decodeURIComponent(filepath)}`;
47 const file = fs.readFileSync(fullpath);
38 res.end(file); 48 res.end(file);
39 }); 49 });
40 } 50 }