vue.config.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const fs = require('fs');
  2. // const copywebpackplugin = require('copy-webpack-plugin');
  3. // const { name } = require("./package.json");
  4. const name = dist;
  5. publicPath = process.env.NODE_ENV === "development" ? "/" : `/${name}`;
  6. module.exports = {
  7. publicPath: publicPath, //相对路径
  8. outputDir: name, //打包名称
  9. // assetsDir: `${pagesInfo.outputDir}/assets`,
  10. productionSourceMap: false,
  11. lintOnSave: false, //关闭lint代码
  12. css: {
  13. loaderOptions: {
  14. less: {
  15. javascriptEnabled: true,
  16. },
  17. },
  18. },
  19. devServer: {
  20. historyApiFallback: {
  21. // rewrites: pagesInfo.devServerPath,
  22. },
  23. port: 9906,
  24. proxy: {
  25. "/duoduo-service": {
  26. target: "http://api.sagacloud.cn",
  27. changeOrigin: true,
  28. secure: false,
  29. }
  30. }
  31. },
  32. chainWebpack: (config) => {
  33. // config
  34. // .plugin('copy')
  35. // .use(copywebpackplugin, [
  36. // [{
  37. // from: 'src/public',
  38. // to: 'public',
  39. // toType: 'dir',
  40. // }],
  41. // ]);
  42. },
  43. };