vue.config.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. const path = require('path');
  2. function resolve(dir) {
  3. return path.join(__dirname, dir)
  4. }
  5. module.exports = {
  6. publicPath: "./", // 默认'/',部署应用包时的基本 URL
  7. indexPath: 'index.html', // 相对于打包路径index.html的路径
  8. outputDir: 'dist', // 'dist', 生产环境构建文件的目录
  9. assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录
  10. lintOnSave: true, // 是否在开发环境下通过 eslint-loader 在每次保存时 lint 代码
  11. runtimeCompiler: true, // 是否使用包含运行时编译器的 Vue 构建版本
  12. chainWebpack: (config) => {
  13. config.resolve.alias
  14. .set('@$', resolve('src'))
  15. .set('assets', resolve('src/assets'))
  16. .set('components', resolve('src/components'))
  17. .set('layout', resolve('src/layout'))
  18. .set('base', resolve('src/base'))
  19. .set('static', resolve('src/static'))
  20. .set("api", resolve("src/api"))
  21. .set("utils", resolve("src/utils"))
  22. .set("views", resolve("src/views"))
  23. .set("styles", resolve("src/assets/styles"))
  24. .set("img", resolve("src/assets/img"))
  25. .set("icons", resolve("src/assets/icons"))
  26. .set("router", resolve("src/router"))
  27. },
  28. configureWebpack: {
  29. devtool: 'source-map'
  30. },
  31. pluginOptions: {
  32. electronBuilder: {
  33. nodeIntegration: true,
  34. builderOptions: {
  35. appId: 'com.neic.gyee',
  36. win: {
  37. icon: 'src/assets/img/logo.ico'
  38. },
  39. linux: {
  40. }
  41. }
  42. }
  43. }
  44. }