vue.config.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. var webpack = require("webpack");
  2. /** @type {import("@vue/cli-service").ProjectOptions} */
  3. module.exports = {
  4. // 这里设置项目的路径,比如 '/admin' 。设置以后 BASE_URL就有值了。
  5. // 注意这解决不了CDN的问题,CDN的问题要另行研究。
  6. // 可能的方案是另设一个替代 BASE_URL 的环境变量解决 <%%= BASE_URL %%>favicon.ico 和 ${process.env.BASE_URL}service-worker.js
  7. publicPath: "/",
  8. lintOnSave: process.env.NODE_ENV !== "production" ? true : "error",
  9. configureWebpack: {
  10. devtool: "source-map",
  11. plugins: [
  12. // Ignore all locale files of moment.js
  13. // TODO: use webpack stats to check if iview locale matters
  14. new webpack.IgnorePlugin(/^\.\/locale$/, /moment|iview$/),
  15. ],
  16. // sequelize bug: https://github.com/sequelize/sequelize/issues/7509
  17. externals: ["mysql"],
  18. },
  19. transpileDependencies: [/\bvue-awesome\b/],
  20. pluginOptions: {
  21. electronBuilder: {
  22. preload: "src/preload.ts",
  23. externals: [],
  24. productName: "云阅卷",
  25. builderOptions: {
  26. extraFiles: ["font/**", "imagemagick/**"],
  27. win: {
  28. target: "portable",
  29. icon: "build/icon/logo.ico",
  30. signAndEditExecutable: false,
  31. publisherName: "启明泰和",
  32. publish: {
  33. provider: "generic",
  34. url: "url",
  35. channel: "latest",
  36. publishAutoUpdate: false,
  37. },
  38. },
  39. linux: {
  40. target: ["AppImage"],
  41. },
  42. },
  43. },
  44. },
  45. };