vue.config.js 912 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. 'link-color': '#d14424',
  17. },
  18. javascriptEnabled: true,
  19. },
  20. },
  21. },
  22. },
  23. chainWebpack: config => {
  24. config.module
  25. .rule('images')
  26. .use('url-loader')
  27. .loader('url-loader')
  28. .tap(options => Object.assign(options, { limit: 5120 }))
  29. },
  30. configureWebpack: {
  31. plugins: [
  32. new StyleLintPlugin({
  33. files: ['src/**/*.{vue,html,css,scss,sass,less}'],
  34. failOnError: false,
  35. cache: false,
  36. fix: false,
  37. }),
  38. ],
  39. },
  40. }