vue.config.js 1.0 KB

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