tauri-config.js 959 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. const appPaths = require('./app-paths')
  2. const merge = require('webpack-merge')
  3. module.exports = cfg => {
  4. const tauriConf = require(appPaths.resolve.app('tauri.conf.js'))(cfg.ctx)
  5. const config = merge({
  6. build: {
  7. distDir: './dist'
  8. },
  9. ctx: {},
  10. tauri: {
  11. embeddedServer: {
  12. active: true
  13. },
  14. bundle: {
  15. active: true
  16. },
  17. whitelist: {
  18. all: false
  19. },
  20. window: {
  21. title: require(appPaths.resolve.app('package.json')).productName
  22. },
  23. security: {
  24. csp: 'default-src data: filesystem: ws: http: https: \'unsafe-eval\' \'unsafe-inline\''
  25. },
  26. automaticStart: {
  27. active: false,
  28. devArgs: [],
  29. buildArgs: []
  30. },
  31. edge: {
  32. active: true
  33. }
  34. }
  35. }, tauriConf, cfg)
  36. process.env.TAURI_DIST_DIR = appPaths.resolve.app(config.build.distDir)
  37. process.env.TAURI_CONFIG_DIR = appPaths.tauriDir
  38. return config
  39. }