tauri-config.js 863 B

12345678910111213141516171819202122232425262728293031323334353637
  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. }
  32. }, tauriConf, cfg)
  33. process.env.TAURI_DIST_DIR = appPaths.resolve.app(config.build.distDir)
  34. return config
  35. }