From 084c509fad0fdf2415587e0e3af8e86fd306447a Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Wed, 29 Jan 2020 02:39:04 +0100 Subject: viewer: fix for the developper server when URLs with parameters are used (timestamps) --- viewer/vue.config.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 614f975..55cd2e7 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -33,8 +33,11 @@ module.exports = { before: (app, server, compiler) => { app.get(`${process.env.VUE_APP_DATA_URL}*`, (req, res) => { const fs = require("fs"); - const fileName = `${process.env.VUE_APP_EXAMPLE_PROJECT}${req.url.slice(process.env.VUE_APP_DATA_URL.length)}`; - const file = fs.readFileSync(decodeURIComponent(fileName)); + const url = req.url.slice(process.env.VUE_APP_DATA_URL.length); + const paramIdx = url.indexOf('?'); + const filepath = paramIdx < 0 ? url : url.substring(0, paramIdx); + const fullpath = `${process.env.VUE_APP_EXAMPLE_PROJECT}${decodeURIComponent(filepath)}`; + const file = fs.readFileSync(fullpath); res.end(file); }); } -- cgit v1.2.3 From 8670fb146e90f98653c776b01f29d905e5a6fe9f Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Wed, 29 Jan 2020 23:11:55 +0100 Subject: viewer: fixed subdirectory deploiement; all paths are now relative to index.html. resolves #17 --- viewer/vue.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 55cd2e7..67b7461 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -18,6 +18,7 @@ */ module.exports = { + publicPath: "./", pluginOptions: { i18n: { locale: "en", @@ -31,7 +32,7 @@ module.exports = { port: 8085, serveIndex: true, before: (app, server, compiler) => { - app.get(`${process.env.VUE_APP_DATA_URL}*`, (req, res) => { + app.get(`/${process.env.VUE_APP_DATA_URL}*`, (req, res) => { const fs = require("fs"); const url = req.url.slice(process.env.VUE_APP_DATA_URL.length); const paramIdx = url.indexOf('?'); -- cgit v1.2.3 From 41741f1882c019edac15b1a05f51b72e5af069f7 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 7 Feb 2020 07:55:09 +0100 Subject: viewer: project optimization for faster init, and a better Visual Studio Code environnement --- viewer/vue.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 67b7461..1ef0f9b 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -27,9 +27,12 @@ module.exports = { enableInSFC: false, }, }, + configureWebpack: { + devtool: 'source-map' + }, productionSourceMap: false, devServer: { - port: 8085, + port: process.env.VUE_APP_DEVSERVER_PORT, serveIndex: true, before: (app, server, compiler) => { app.get(`/${process.env.VUE_APP_DATA_URL}*`, (req, res) => { -- cgit v1.2.3 From 8b8ff179021a204930253a310cc2e9213e342fd1 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 8 Feb 2020 09:14:03 +0100 Subject: viewer: fixed an issue with prefetching du to webpack chunking --- viewer/vue.config.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 1ef0f9b..9d885bd 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -27,6 +27,9 @@ module.exports = { enableInSFC: false, }, }, + chainWebpack: (config) => { + config.plugins.delete('prefetch'); + }, configureWebpack: { devtool: 'source-map' }, -- cgit v1.2.3 From 19d40a5ee98fb1f244612155acc559ff2f21bf6b Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Wed, 12 Feb 2020 00:09:34 +0100 Subject: viewer: implemented config.json Note: The DevServer needs to know when the file is from the App, or from the FileSystem. We use a tilde to make this separation. The tilde URL is declared in '.env.development' GitHub: Resolves #32 --- viewer/vue.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 9d885bd..9b92dc2 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -43,7 +43,7 @@ module.exports = { const url = req.url.slice(process.env.VUE_APP_DATA_URL.length); const paramIdx = url.indexOf('?'); const filepath = paramIdx < 0 ? url : url.substring(0, paramIdx); - const fullpath = `${process.env.VUE_APP_EXAMPLE_PROJECT}${decodeURIComponent(filepath)}`; + const fullpath = `${process.env.VUE_APP_DEVSERVER_CONFIG_PATH}${decodeURIComponent(filepath)}`; const file = fs.readFileSync(fullpath); res.end(file); }); -- cgit v1.2.3 From 113bff3c4dcc1976f24df16d4224e1871e665ae0 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Mon, 27 Apr 2020 22:23:10 +0200 Subject: viewer: tabSize, quote-props, quotes, object-curly-spacing --- viewer/vue.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 9b92dc2..f481e4f 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -28,10 +28,10 @@ module.exports = { }, }, chainWebpack: (config) => { - config.plugins.delete('prefetch'); + config.plugins.delete("prefetch"); }, configureWebpack: { - devtool: 'source-map' + devtool: "source-map" }, productionSourceMap: false, devServer: { @@ -41,7 +41,7 @@ module.exports = { app.get(`/${process.env.VUE_APP_DATA_URL}*`, (req, res) => { const fs = require("fs"); const url = req.url.slice(process.env.VUE_APP_DATA_URL.length); - const paramIdx = url.indexOf('?'); + const paramIdx = url.indexOf("?"); const filepath = paramIdx < 0 ? url : url.substring(0, paramIdx); const fullpath = `${process.env.VUE_APP_DEVSERVER_CONFIG_PATH}${decodeURIComponent(filepath)}`; const file = fs.readFileSync(fullpath); -- cgit v1.2.3