vue.config.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. const ENV = process.env.NODE_ENV
  2. const path = require('path')
  3. function resolve (dir) {
  4. return path.join(__dirname, dir)
  5. }
  6. module.exports = {
  7. // indexPath: ENV === 'production' ? '../protected/views/index.html' : 'index.html',
  8. outputDir: './dist', // build 时生成的生产环境构建文件的目录
  9. baseUrl: ENV === 'production' ? '/dist/' : '/',
  10. lintOnSave: true, // 关闭eslint
  11. productionSourceMap: false, // 生产环境取消source map
  12. pages: {
  13. index: {
  14. entry: '_src/pages/index/main.js',
  15. title: 'MeeChat',
  16. filename: ENV === 'production' ? '../protected/views/index.html' : 'index.html'
  17. },
  18. mini: {
  19. entry: '_src/pages/mini/main.js',
  20. template: 'public/mini.html',
  21. title: 'MeeChat',
  22. filename: ENV === 'production' ? '../protected/views/mini.html' : 'mini.html'
  23. }
  24. },
  25. chainWebpack: (config) => {
  26. config.resolve.alias
  27. .set('@', resolve('_src'))
  28. },
  29. css: {
  30. loaderOptions: {
  31. sass: {
  32. data: `@import "@/style/mixins.scss";`
  33. }
  34. }
  35. }
  36. }