vue.config.js 909 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. module.exports = {
  2. parallel: false,
  3. productionSourceMap: false,
  4. outputDir: './dist',
  5. publicPath: process.env.VUE_APP_BASE_PUBLIC,
  6. lintOnSave: true,
  7. devServer: {
  8. port: '8080',
  9. disableHostCheck: true,
  10. proxy: {
  11. '^/api-docs': {
  12. target: 'http://xxx.com/api-docs',
  13. changeOrigin: true,
  14. pathRewrite: {
  15. '^/api-docs': ''
  16. }
  17. }
  18. }
  19. },
  20. css: {
  21. loaderOptions: {
  22. sass: {
  23. prependData: '@import "@/assets/style/_mixin.scss";@import "@/assets/style/_variables.scss";'
  24. }
  25. }
  26. },
  27. chainWebpack: config => {
  28. if (!process.env.VUE_APP_ALONE) {
  29. config.devServer.set('inline', false)
  30. config.devServer.set('hot', true)
  31. if (process.env.NODE_ENV !== 'production') {
  32. config.output.filename('js/[name].js')
  33. }
  34. config.externals(['vue', 'vue-router'])
  35. }
  36. },
  37. filenameHashing: false
  38. }