vue.config.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. "use strict";
  2. const path = require("path");
  3. // const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
  4. // .BundleAnalyzerPlugin;
  5. function resolve(dir) {
  6. return path.join(__dirname, dir);
  7. }
  8. const name = "机动车安全及尾气检测"; // page title
  9. // If your port is set to 80,
  10. // use administrator privileges to execute the command line.
  11. // For example, Mac: sudo npm run
  12. // You can change the port by the following methods:
  13. // port = 9528 npm run dev OR npm run dev --port = 9528
  14. const port = process.env.port || process.env.npm_config_port || 9528; // dev port
  15. // All configuration item explanations can be find in https://cli.vuejs.org/config/
  16. module.exports = {
  17. /**
  18. * You will need to set publicPath if you plan to deploy your site under a sub path,
  19. * for example GitHub Pages. If you plan to deploy your site to htt6ps://foo.github.io/bar/,
  20. * then publicPath should be set to "/bar/".
  21. * In most cases please use '/' !!!
  22. * Detail: https://cli.vuejs.org/config/#publicpath
  23. */
  24. publicPath: "./",
  25. outputDir: "dist",
  26. assetsDir: "static",
  27. lintOnSave: false,
  28. productionSourceMap: false,
  29. runtimeCompiler: true,
  30. devServer: {
  31. port: port,
  32. open: false,
  33. overlay: {
  34. warnings: false,
  35. errors: true,
  36. },
  37. // proxy: {
  38. // onProxyReq: function(proxyReq) {
  39. // proxyReq.removeHeader("origin");
  40. // }
  41. // },
  42. // before: require("./mock/mock-server.js")
  43. },
  44. configureWebpack: {
  45. // provide the app's title in webpack's name field, so that
  46. // it can be accessed in index.html to inject the correct title.
  47. name: name,
  48. resolve: {
  49. alias: {
  50. "@": resolve("src"),
  51. },
  52. },
  53. },
  54. };