vue.config.js 950 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const path = require('path');
  2. function resolve(dir = '') {
  3. return path.join(__dirname, './src', dir);
  4. }
  5. module.exports = {
  6. publicPath: './',
  7. outputDir: 'dist',
  8. assetsDir: 'static',
  9. productionSourceMap: false,
  10. devServer: {
  11. //九键输入法的 「mall」= 「6255」
  12. port: 6255,
  13. },
  14. chainWebpack: config => {
  15. config.plugins.delete('prefetch');
  16. config.plugins.delete('preload');
  17. },
  18. configureWebpack: {
  19. resolve: {
  20. alias: {
  21. core: resolve('core')
  22. }
  23. },
  24. optimization: {
  25. runtimeChunk: {
  26. name: entrypoint => `runtime~${entrypoint.name}`
  27. },
  28. splitChunks: {
  29. minChunks: 2,
  30. minSize: 20000,
  31. maxAsyncRequests: 20,
  32. maxInitialRequests: 30,
  33. name: false
  34. }
  35. }
  36. },
  37. css: {
  38. loaderOptions: {
  39. sass: {
  40. data:
  41. '@import "@/assets/scss/_var.scss";@import "@/assets/scss/_mixin.scss";'
  42. }
  43. }
  44. }
  45. };