aboutsummaryrefslogtreecommitdiff
path: root/viewer/vue.config.js
blob: dbf1551f4bce54c8bc53624d033834607fbd1703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module.exports = {
  pluginOptions: {
    i18n: {
      locale: "en",
      fallbackLocale: "en",
      localeDir: "locales",
      enableInSFC: false,
    },
  },
  productionSourceMap: false,
  devServer: {
    port: 8085,
    serveIndex: true,
    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));
        res.end(file);
      });
    }
  }
};