vue.config.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. const path = require('path');
  2. const fs = require('fs');
  3. let publicPath;
  4. switch (process.env.NODE_ENV) {
  5. case 'development':
  6. publicPath = '/';
  7. break;
  8. case 'production':
  9. publicPath = '/9th/';
  10. break;
  11. case 'test':
  12. publicPath = '/9th/';
  13. break;
  14. }
  15. module.exports = {
  16. publicPath: publicPath,
  17. devServer: {
  18. port: 8081,
  19. disableHostCheck: true
  20. },
  21. pluginOptions: {
  22. 'style-resources-loader': {
  23. preProcessor: 'less',
  24. patterns: [path.resolve(__dirname, './src/styles/common/', process.env.ASSETS_PATH || '9th', '*.less')]
  25. }
  26. },
  27. chainWebpack: config => {
  28. config.output.filename('[name].[hash].js').end();
  29. config.resolve.alias.set('@assets', path.resolve(__dirname, 'src', 'assets', process.env.ASSETS_PATH || '9th'));
  30. config.plugin('html').tap(args => {
  31. args[0].title = process.env.TITLE;
  32. args[0].app = process.env.VUE_APP_CORDOVA === 'true';
  33. return args;
  34. });
  35. },
  36. transpileDependencies: ['element-ui', 'swiper', 'ssr-window', 'dom7', 'vue-awesome-swiper', 'vuex'],
  37. runtimeCompiler: true
  38. };