vue.config.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. signAndEditExecutable: false,
  30. publisherName: "启明泰和",
  31. publish: {
  32. provider: "generic",
  33. url: "url",
  34. channel: "latest",
  35. publishAutoUpdate: false,
  36. },
  37. },
  38. },
  39. },
  40. },
  41. };