balm-core 4.28.0 → 4.29.0

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.
package/index.d.ts CHANGED
@@ -155,10 +155,7 @@ export interface BalmAssets extends Partial<BalmAssetsPath> {
155
155
  excludes: string[];
156
156
  }
157
157
 
158
- export interface BalmProxyConfig {
159
- context: string | string[];
160
- options: object;
161
- }
158
+ export type BalmProxyOptions = import('http-proxy-middleware').Options;
162
159
 
163
160
  interface BalmServer {
164
161
  port: number;
@@ -171,7 +168,7 @@ interface BalmServer {
171
168
  options: any;
172
169
  devOptions: object;
173
170
  hotOptions: object;
174
- proxyConfig: boolean | BalmProxyConfig | BalmProxyConfig[];
171
+ proxyOptions: boolean | BalmProxyOptions | BalmProxyOptions[];
175
172
  historyOptions: boolean | object;
176
173
  middlewares: Function[] | object[];
177
174
  extraWatchFiles: string[];
@@ -1,7 +1,7 @@
1
1
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
2
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
6
  import dotenv from 'dotenv';
7
7
  import dotenvExpand from 'dotenv-expand';
@@ -35,35 +35,28 @@ const hotOptions = {
35
35
  /**
36
36
  * Http-proxy middleware
37
37
  *
38
- * @reference https://github.com/chimurai/http-proxy-middleware#context-matching
39
38
  * @reference https://github.com/chimurai/http-proxy-middleware#options
40
39
  *
41
40
  * @example
42
41
  * Single proxy example
43
42
  * {
44
- * context: '/api',
45
- * options: {
46
- * target: 'http://www.example.org',
47
- * changeOrigin: true
48
- * }
43
+ * target: 'http://www.example.org',
44
+ * changeOrigin: true,
45
+ * pathFilter: '/api'
49
46
  * }
50
47
  * @example
51
48
  * Multiple proxies example
52
49
  * [{
53
- * context: '/api',
54
- * options: {
55
- * target: 'http://www.example.org',
56
- * changeOrigin: true
57
- * }
50
+ * target: 'http://www.example.org',
51
+ * changeOrigin: true,
52
+ * pathFilter: '/api'
58
53
  * }, {
59
- * context: ['/api2', '/api3'],
60
- * options: {
61
- * target: 'http://www.example2.org',
62
- * changeOrigin: true
63
- * }
54
+ * target: 'http://www.example2.org',
55
+ * changeOrigin: true,
56
+ * pathFilter: ['/api2', '/api3']
64
57
  * }]
65
58
  */
66
- const proxyConfig = false;
59
+ const proxyOptions = false;
67
60
  /**
68
61
  * HTML 5 history API
69
62
  *
@@ -84,7 +77,7 @@ export default {
84
77
  next,
85
78
  devOptions,
86
79
  hotOptions,
87
- proxyConfig,
80
+ proxyOptions,
88
81
  historyOptions,
89
82
  middlewares,
90
83
  extraWatchFiles
@@ -1,32 +1,20 @@
1
1
  import { createProxyMiddleware } from 'http-proxy-middleware';
2
- function handleProxyConfigError() {
3
- const configuration = '{ context: string | array, options: object }';
4
- BalmJS.logger.error('proxy middleware', `Proxy config must be an object (${configuration}) or array ([${configuration}])`);
5
- }
6
2
  function httpProxyMiddleware() {
7
3
  const middleware = [];
8
- const proxyConfig = BalmJS.config.server.proxyConfig;
9
- if (proxyConfig) {
4
+ const proxyOptions = BalmJS.config.server.proxyOptions;
5
+ if (proxyOptions) {
10
6
  try {
11
- if (BalmJS.utils.isObject(proxyConfig)) {
7
+ if (BalmJS.utils.isObject(proxyOptions)) {
12
8
  // Single proxy
13
- const config = proxyConfig;
14
- if (config.context && config.options) {
15
- middleware.push(createProxyMiddleware(config.context, config.options));
16
- } else {
17
- handleProxyConfigError();
18
- }
19
- } else if (BalmJS.utils.isArray(proxyConfig)) {
9
+ const options = proxyOptions;
10
+ middleware.push(createProxyMiddleware(options));
11
+ } else if (BalmJS.utils.isArray(proxyOptions)) {
20
12
  // Multiple proxies
21
- for (const config of proxyConfig) {
22
- if (config.context && config.options) {
23
- middleware.push(createProxyMiddleware(config.context, config.options));
24
- } else {
25
- handleProxyConfigError();
26
- }
13
+ for (const options of proxyOptions) {
14
+ middleware.push(createProxyMiddleware(options));
27
15
  }
28
16
  } else {
29
- handleProxyConfigError();
17
+ BalmJS.logger.error('proxy middleware', `Proxy options (https://github.com/chimurai/http-proxy-middleware#options) must be an object or array`);
30
18
  }
31
19
  } catch (error) {
32
20
  const {
@@ -1,7 +1,7 @@
1
1
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
2
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
6
  // Reference `gulp-replace@1.1.4`
7
7
  import { Transform } from 'node:stream';
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  class BalmTask {
5
5
  constructor(name) {
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  import gulpSize from 'gulp-size';
5
5
  class BuildTask extends BalmJS.BalmTask {
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  import revAll from 'gulp-rev-all';
5
5
  import { ASSETS_TYPES, CHUNK, ASSET } from '../../config/constants.js';
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
5
5
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  class EndTask extends BalmJS.BalmTask {
5
5
  constructor() {
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  class ExtraTask extends BalmJS.BalmTask {
5
5
  constructor() {
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  class FontTask extends BalmJS.BalmTask {
5
5
  constructor() {
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  import { getDefaultImagePlugins } from '../../plugins/imagemin.js';
5
5
  class ImageTask extends BalmJS.BalmTask {
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  class LintTask extends BalmJS.BalmTask {
5
5
  constructor() {
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  class MediaTask extends BalmJS.BalmTask {
5
5
  constructor() {
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
5
5
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  import { deleteAsync } from 'del';
5
5
  class PwaCacheTask extends BalmJS.BalmTask {
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  class StartTask extends BalmJS.BalmTask {
5
5
  constructor() {
@@ -1,5 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  class WorkboxSwTask extends BalmJS.BalmTask {
5
5
  constructor() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "balm-core",
3
- "version": "4.28.0",
3
+ "version": "4.29.0",
4
4
  "description": "BalmJS compiler core",
5
5
  "keywords": [
6
6
  "balm",
@@ -44,13 +44,13 @@
44
44
  "@rollup/plugin-terser": "^0.4.4",
45
45
  "ansi-colors": "^4.1.3",
46
46
  "async": "^3.2.5",
47
- "autoprefixer": "^10.4.17",
47
+ "autoprefixer": "^10.4.19",
48
48
  "babel-loader": "^9.1.3",
49
49
  "browser-sync": "^3.0.2",
50
50
  "connect-history-api-fallback": "^2.0.0",
51
- "css-loader": "^6.10.0",
51
+ "css-loader": "^7.0.0",
52
52
  "css-minimizer-webpack-plugin": "^6.0.0",
53
- "cssnano": "^6.0.5",
53
+ "cssnano": "^6.1.2",
54
54
  "del": "^7.1.0",
55
55
  "dotenv": "^16.4.5",
56
56
  "dotenv-expand": "^11.0.6",
@@ -68,7 +68,7 @@
68
68
  "html-loader": "^5.0.0",
69
69
  "html-minifier": "^4.0.0",
70
70
  "html-webpack-plugin": "^5.6.0",
71
- "http-proxy-middleware": "^2.0.6",
71
+ "http-proxy-middleware": "^3.0.0",
72
72
  "imagemin": "^8.0.1",
73
73
  "istextorbinary": "^9.5.0",
74
74
  "less": "^4.2.0",
@@ -76,32 +76,32 @@
76
76
  "modernizr": "^3.13.0",
77
77
  "parents": "^1.0.1",
78
78
  "plugin-error": "^2.0.1",
79
- "postcss": "^8.4.35",
79
+ "postcss": "^8.4.38",
80
80
  "postcss-flexbugs-fixes": "^5.0.2",
81
- "postcss-import": "^16.0.1",
81
+ "postcss-import": "^16.1.0",
82
82
  "postcss-load-config": "^5.0.3",
83
83
  "postcss-loader": "^8.1.1",
84
- "postcss-preset-env": "^9.4.0",
84
+ "postcss-preset-env": "^9.5.4",
85
85
  "pretty-bytes": "^6.1.1",
86
86
  "readable-stream": "^4.5.2",
87
87
  "replace-ext": "^2.0.0",
88
- "rollup": "^4.12.0",
89
- "sass": "^1.71.1",
88
+ "rollup": "^4.14.0",
89
+ "sass": "^1.74.1",
90
90
  "sass-loader": "^14.1.1",
91
91
  "semver": "^7.6.0",
92
92
  "ssh2": "^1.15.0",
93
93
  "strip-ansi": "^7.1.0",
94
94
  "style-loader": "^3.3.4",
95
- "tailwindcss": "^3.4.1",
96
- "terser": "^5.28.1",
95
+ "tailwindcss": "^3.4.3",
96
+ "terser": "^5.30.3",
97
97
  "terser-webpack-plugin": "^5.3.10",
98
98
  "through2": "^4.0.2",
99
99
  "through2-concurrent": "^2.0.0",
100
100
  "tslib": "^2.6.2",
101
101
  "vinyl-sourcemaps-apply": "^0.2.1",
102
- "webpack": "^5.90.3",
102
+ "webpack": "^5.91.0",
103
103
  "webpack-bundle-analyzer": "^4.10.1",
104
- "webpack-dev-middleware": "^7.0.0",
104
+ "webpack-dev-middleware": "^7.2.1",
105
105
  "webpack-hot-middleware": "^2.26.1",
106
106
  "webpack-merge": "^5.10.0",
107
107
  "workbox-build": "^7.0.0"
@@ -130,5 +130,5 @@
130
130
  "engines": {
131
131
  "node": ">=18.12.0"
132
132
  },
133
- "gitHead": "aaa9a36f620bcc9e22ba44d9abb3f730349f78dd"
133
+ "gitHead": "8cff203ffacbe64b726e713915f3b8c7ccd45405"
134
134
  }
@@ -11,7 +11,7 @@ const hotOptions = {
11
11
  reload: true,
12
12
  noInfo: true
13
13
  };
14
- const proxyConfig = false;
14
+ const proxyOptions = false;
15
15
  const historyOptions = false;
16
16
  const middlewares = [];
17
17
  const extraWatchFiles = [];
@@ -26,7 +26,7 @@ export default {
26
26
  next,
27
27
  devOptions,
28
28
  hotOptions,
29
- proxyConfig,
29
+ proxyOptions,
30
30
  historyOptions,
31
31
  middlewares,
32
32
  extraWatchFiles
@@ -1,34 +1,20 @@
1
1
  import { createProxyMiddleware } from 'http-proxy-middleware';
2
- function handleProxyConfigError() {
3
- const configuration = '{ context: string | array, options: object }';
4
- BalmJS.logger.error('proxy middleware', `Proxy config must be an object (${configuration}) or array ([${configuration}])`);
5
- }
6
2
  function httpProxyMiddleware() {
7
3
  const middleware = [];
8
- const proxyConfig = BalmJS.config.server.proxyConfig;
9
- if (proxyConfig) {
4
+ const proxyOptions = BalmJS.config.server.proxyOptions;
5
+ if (proxyOptions) {
10
6
  try {
11
- if (BalmJS.utils.isObject(proxyConfig)) {
12
- const config = proxyConfig;
13
- if (config.context && config.options) {
14
- middleware.push(createProxyMiddleware(config.context, config.options));
15
- }
16
- else {
17
- handleProxyConfigError();
18
- }
7
+ if (BalmJS.utils.isObject(proxyOptions)) {
8
+ const options = proxyOptions;
9
+ middleware.push(createProxyMiddleware(options));
19
10
  }
20
- else if (BalmJS.utils.isArray(proxyConfig)) {
21
- for (const config of proxyConfig) {
22
- if (config.context && config.options) {
23
- middleware.push(createProxyMiddleware(config.context, config.options));
24
- }
25
- else {
26
- handleProxyConfigError();
27
- }
11
+ else if (BalmJS.utils.isArray(proxyOptions)) {
12
+ for (const options of proxyOptions) {
13
+ middleware.push(createProxyMiddleware(options));
28
14
  }
29
15
  }
30
16
  else {
31
- handleProxyConfigError();
17
+ BalmJS.logger.error('proxy middleware', `Proxy options (https://github.com/chimurai/http-proxy-middleware#options) must be an object or array`);
32
18
  }
33
19
  }
34
20
  catch (error) {