vue.config.js 942 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. const { defineConfig } = require("@vue/cli-service");
  2. module.exports = defineConfig({
  3. transpileDependencies: true,
  4. productionSourceMap: false,
  5. assetsDir: "viewer",
  6. css: {
  7. extract: false,
  8. loaderOptions: {
  9. scss: {},
  10. },
  11. },
  12. // 修改或新增html-webpack-plugin的值,在index.html里面能读取htmlWebpackPlugin.options.title
  13. chainWebpack: config =>{
  14. config.plugin('html').tap(args => {
  15. args[0].title = process.env.VUE_APP_APIS_TITLE;
  16. return args;
  17. })
  18. },
  19. devServer: {
  20. // port: 443,
  21. https: false,
  22. // disableHostCheck: true,
  23. headers: {
  24. "Cache-Control": "no-store",
  25. },
  26. proxy: {
  27. "/service": {
  28. // target: "https://v4-test.4dkankan.com/",
  29. target: process.env.VUE_APP_APIS_URL,
  30. changeOrigin: true,
  31. },
  32. "/api": {
  33. target: process.env.VUE_APP_APIS_URL,
  34. changeOrigin: true,
  35. },
  36. },
  37. },
  38. });