vue.config.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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: ["pg", "sqlite3", "tedious", "pg-hstore"],
  18. },
  19. transpileDependencies: [/\bvue-awesome\b/],
  20. pluginOptions: {
  21. electronBuilder: {
  22. externals: [],
  23. builderOptions: {
  24. extraFiles: ["extra/**"],
  25. win: {
  26. target: "portable",
  27. signAndEditExecutable: false,
  28. publisherName: "启明泰和",
  29. publish: {
  30. provider: "generic",
  31. url: "url",
  32. channel: "latest",
  33. publishAutoUpdate: false,
  34. },
  35. },
  36. },
  37. },
  38. },
  39. };