vue.config.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. const StyleLintPlugin = require('stylelint-webpack-plugin')
  2. module.exports = {
  3. publicPath: './',
  4. css: {
  5. loaderOptions: {
  6. sass: {
  7. prependData: `
  8. @import "~@/assets/styles/variable.scss";
  9. @import "~@/assets/styles/mixin.scss";
  10. `,
  11. },
  12. less: {
  13. lessOptions: {
  14. modifyVars: {
  15. 'primary-color': '#d14424',
  16. 'text-color': '#41464b',
  17. 'font-size-base': '13px',
  18. 'border-radius-base': '2px',
  19. 'box-shadow-base': '3px 3px 3px rgba(#000, 0.15)',
  20. },
  21. javascriptEnabled: true,
  22. },
  23. },
  24. },
  25. },
  26. chainWebpack: config => {
  27. config.module
  28. .rule('images')
  29. .use('url-loader')
  30. .loader('url-loader')
  31. .tap(options => Object.assign(options, { limit: 5120 }))
  32. },
  33. configureWebpack: {
  34. plugins: [
  35. new StyleLintPlugin({
  36. files: ['src/**/*.{vue,html,css,scss,sass,less}'],
  37. failOnError: false,
  38. cache: false,
  39. fix: false,
  40. }),
  41. ],
  42. },
  43. }