vue.config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * @Author: lf
  3. * @Date: 2022-09-28 18:56:09
  4. * @LastEditors: lf
  5. * @LastEditTime: 2022-09-29 09:55:03
  6. * @FilePath: \abc\vue.config.js
  7. * @Description:
  8. * @custom_string_lf: 你可以期待太阳从东方升起,而风却随心所欲地从四面八方吹来。 --萨特
  9. */
  10. const path = require('path')
  11. function resolve (dir) {
  12. return path.join(__dirname, dir)
  13. }
  14. module.exports = {
  15. transpileDependencies: [/node_modules[/\\\\](.*)[/\\\\]/,"sock-js","sockjs-client"],
  16. // 配置css
  17. css: {
  18. // 是否使用css分离插件 ExtractTextPlugin
  19. // extract: process.env.NODE_ENV === 'production',
  20. sourceMap: true,
  21. },
  22. pluginOptions: {
  23. 'style-resources-loader': {
  24. preProcessor: 'scss',
  25. patterns: [
  26. resolve('src/style/mixins/mixins.scss'),
  27. resolve('src/style/mixins.scss'),
  28. resolve('src/style/variables.scss'),
  29. ],
  30. },
  31. },
  32. chainWebpack: (config) => {
  33. // 配置别名
  34. config.resolve.alias
  35. .set('@', resolve('src'))
  36. .set('assets', resolve('src/assets'))
  37. .set('style', resolve('src/style'))
  38. .set('plugin', resolve('src/plugin'))
  39. .set('components', resolve('src/components'))
  40. config.entry('main').add('babel-polyfill')
  41. },
  42. }