vue.config.js 941 B

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