frappe-ui 0.1.42 → 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/vite.js +14 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frappe-ui",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
package/vite.js CHANGED
@@ -1,27 +1,30 @@
1
1
  const path = require('path')
2
2
  const fs = require('fs')
3
3
 
4
- module.exports = function proxyOptions({ port = 8080 } = {}) {
4
+ module.exports = function proxyOptions({
5
+ port = 8080,
6
+ source = '^/(app|login|api|assets|files)',
7
+ } = {}) {
5
8
  const config = getCommonSiteConfig()
6
9
  const webserver_port = config ? config.webserver_port : 8000
7
10
  if (!config) {
8
11
  console.log('No common_site_config.json found, using default port 8000')
9
12
  }
13
+ let proxy = {}
14
+ proxy[source] = {
15
+ target: `http://127.0.0.1:${webserver_port}`,
16
+ ws: true,
17
+ router: function (req) {
18
+ const site_name = req.headers.host.split(':')[0]
19
+ return `http://${site_name}:${webserver_port}`
20
+ }
21
+ }
10
22
  return {
11
23
  name: 'frappeui-vite-plugin',
12
24
  config: () => ({
13
25
  server: {
14
26
  port: port,
15
- proxy: {
16
- '^/(app|login|api|assets|files)': {
17
- target: `http://127.0.0.1:${webserver_port}`,
18
- ws: true,
19
- router: function (req) {
20
- const site_name = req.headers.host.split(':')[0]
21
- return `http://${site_name}:${webserver_port}`
22
- },
23
- },
24
- },
27
+ proxy: proxy,
25
28
  },
26
29
  }),
27
30
  }