logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

index.js (2264B)


  1. // see http://vuejs-templates.github.io/webpack for documentation.
  2. const path = require('path')
  3. let settings = {}
  4. try {
  5. settings = require('./local.json')
  6. if (settings.target && settings.target.endsWith('/')) {
  7. // replacing trailing slash since it can conflict with some apis
  8. // and that's how actual BE reports its url
  9. settings.target = settings.target.replace(/\/$/, '')
  10. }
  11. console.log('Using local dev server settings (/config/local.json):')
  12. console.log(JSON.stringify(settings, null, 2))
  13. } catch (e) {
  14. console.log('Local dev server settings not found (/config/local.json)')
  15. }
  16. const target = settings.target || 'http://localhost:4000/'
  17. module.exports = {
  18. build: {
  19. env: require('./prod.env'),
  20. index: path.resolve(__dirname, '../dist/index.html'),
  21. assetsRoot: path.resolve(__dirname, '../dist'),
  22. assetsSubDirectory: 'static',
  23. assetsPublicPath: '/',
  24. productionSourceMap: true,
  25. // Gzip off by default as many popular static hosts such as
  26. // Surge or Netlify already gzip all static assets for you.
  27. // Before setting to `true`, make sure to:
  28. // npm install --save-dev compression-webpack-plugin
  29. productionGzip: false,
  30. productionGzipExtensions: ['js', 'css']
  31. },
  32. dev: {
  33. env: require('./dev.env'),
  34. port: 8080,
  35. settings,
  36. assetsSubDirectory: 'static',
  37. assetsPublicPath: '/',
  38. proxyTable: {
  39. '/api': {
  40. target,
  41. changeOrigin: true,
  42. cookieDomainRewrite: 'localhost'
  43. },
  44. '/nodeinfo': {
  45. target,
  46. changeOrigin: true,
  47. cookieDomainRewrite: 'localhost'
  48. },
  49. '/socket': {
  50. target,
  51. changeOrigin: true,
  52. cookieDomainRewrite: 'localhost',
  53. ws: true,
  54. headers: {
  55. 'Origin': target
  56. }
  57. },
  58. '/oauth/revoke': {
  59. target,
  60. changeOrigin: true,
  61. cookieDomainRewrite: 'localhost'
  62. }
  63. },
  64. // CSS Sourcemaps off by default because relative paths are "buggy"
  65. // with this option, according to the CSS-Loader README
  66. // (https://github.com/webpack/css-loader#sourcemaps)
  67. // In our experience, they generally work as expected,
  68. // just be aware of this issue when enabling this option.
  69. cssSourceMap: false
  70. }
  71. }