vue.config.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. const ENV = process.env.NODE_ENV;
  2. const BUILD_ENV = process.env.BUILD_ENV;
  3. const path = require("path");
  4. const gameUrl = 'baccarat.eosget.io';
  5. function getBaseUrl () {
  6. if (ENV === 'development') {
  7. return '/';
  8. } else if (BUILD_ENV === 'test') {
  9. return '/dist/';
  10. } else {
  11. let pre = BUILD_ENV === 'production' ? '' : `${BUILD_ENV}-`;
  12. return `https://static.meechat.me/cdn/${pre}${gameUrl}/dist/`;
  13. }
  14. }
  15. module.exports = {
  16. indexPath: ENV === 'production' ? '../protected/views/index.html' : 'index.html',
  17. outputDir: "../dist", //build 时生成的生产环境构建文件的目录
  18. baseUrl: getBaseUrl(),
  19. lintOnSave: false, //关闭eslint
  20. productionSourceMap: false, //生产环境取消source map
  21. css: {
  22. loaderOptions: {
  23. sass: {
  24. data: `@import "@/style/mixins.scss";`
  25. }
  26. }
  27. },
  28. configureWebpack: {
  29. resolve: {
  30. alias: {
  31. "@": path.join(__dirname, "src")
  32. }
  33. }
  34. }
  35. };