vue.config.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. const path = require('path')
  2. const webpack = require('webpack')
  3. function resolve(dir) {
  4. return path.join(__dirname, dir)
  5. }
  6. // vue.config.js
  7. module.exports = {
  8. pages: {
  9. index: {
  10. // page 的入口
  11. entry: 'src/main.js',
  12. // 模板来源
  13. template: 'public/index.html',
  14. // 在 dist/index.html 的输出
  15. filename: 'index.html',
  16. // 当使用 title 选项时,
  17. // template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
  18. title: '三维功能示例',
  19. // 在这个页面中包含的块,默认情况下会包含
  20. // 提取出来的通用 chunk 和 vendor chunk。
  21. chunks: ['chunk-vendors', 'chunk-common', 'index']
  22. }
  23. },
  24. // ...other config
  25. configureWebpack: {
  26. // webpack plugins
  27. plugins: [
  28. // Ignore all locale files of moment.js
  29. new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
  30. ]
  31. },
  32. productionSourceMap: false, //打包不生成js.map文件
  33. chainWebpack: (config) => {
  34. config.resolve.alias
  35. .set('@$', resolve('src'))
  36. .set('@static', resolve('public/static'))
  37. },
  38. css: {
  39. loaderOptions: {
  40. less: {
  41. modifyVars: {
  42. 'primary-color': '#F05A28',
  43. 'border-color-base': '#F05A28',
  44. 'heading-color': 'rgba(240, 90, 40, 1)',
  45. // 'text-color': 'rgba(240, 90, 40, 1)',
  46. 'link-color': '#F05A28'
  47. },
  48. javascriptEnabled: true
  49. },
  50. }
  51. },
  52. pluginOptions: {
  53. "style-resources-loader": {
  54. preProcessor: "less",
  55. patterns: [
  56. path.resolve(__dirname, 'src/assets/common/less/variable.less')
  57. ]
  58. }
  59. },
  60. devServer: {
  61. port: 2001,
  62. proxy: {
  63. '/proxy_oauth/': {
  64. target: 'http://121.43.55.7:10086',
  65. changeOrigin: true,
  66. pathRewrite: {
  67. '^/proxy_oauth': ''
  68. }
  69. },
  70. }
  71. }
  72. }