@adobe/helix-deploy 10.0.1 → 10.2.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/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/DevelopmentServer.js +11 -5
- package/src/bundler/WebpackBundler.js +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [10.2.0](https://github.com/adobe/helix-deploy/compare/v10.1.0...v10.2.0) (2024-01-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* allow addition of webpack plugins. ([95eb9bb](https://github.com/adobe/helix-deploy/commit/95eb9bb8019dc969e5b7630a32a4c95efbf4b371)), closes [#641](https://github.com/adobe/helix-deploy/issues/641) [#642](https://github.com/adobe/helix-deploy/issues/642)
|
|
7
|
+
|
|
8
|
+
# [10.1.0](https://github.com/adobe/helix-deploy/compare/v10.0.1...v10.1.0) (2024-01-18)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add support for custom headers ([#640](https://github.com/adobe/helix-deploy/issues/640)) ([a726f7a](https://github.com/adobe/helix-deploy/commit/a726f7a994b9e6c764a107c7f5dde8975adda48f))
|
|
14
|
+
|
|
1
15
|
## [10.0.1](https://github.com/adobe/helix-deploy/compare/v10.0.0...v10.0.1) (2024-01-13)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/DevelopmentServer.js
CHANGED
|
@@ -71,7 +71,7 @@ export default class DevelopmentServer {
|
|
|
71
71
|
this._main = main;
|
|
72
72
|
this._cwd = process.cwd();
|
|
73
73
|
this._port = process.env.WEBSERVER_PORT || 3000;
|
|
74
|
-
this.
|
|
74
|
+
this._headers = {};
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
withPort(value) {
|
|
@@ -80,7 +80,13 @@ export default class DevelopmentServer {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
withXFH(value) {
|
|
83
|
-
|
|
83
|
+
process.emitWarning('DevelopmentServer.withXFH is deprecated. Use withHeader(\'x-forwarded-host\') instead.', 'DeprecationWarning');
|
|
84
|
+
this._headers['x-forwarded-host'] = value;
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
withHeader(name, value) {
|
|
89
|
+
this._headers[name] = value;
|
|
84
90
|
return this;
|
|
85
91
|
}
|
|
86
92
|
|
|
@@ -206,9 +212,9 @@ export default class DevelopmentServer {
|
|
|
206
212
|
}
|
|
207
213
|
});
|
|
208
214
|
this.app.use(rawBody());
|
|
209
|
-
|
|
210
|
-
this.app.use(addRequestHeader(
|
|
211
|
-
}
|
|
215
|
+
Object.entries(this._headers).forEach(([name, value]) => {
|
|
216
|
+
this.app.use(addRequestHeader(name, value.replace('{port}', this._port)));
|
|
217
|
+
});
|
|
212
218
|
this.app.all('*', this._handler);
|
|
213
219
|
}
|
|
214
220
|
|
|
@@ -100,6 +100,15 @@ export default class WebpackBundler extends BaseBundler {
|
|
|
100
100
|
if (cfg.progressHandler) {
|
|
101
101
|
opts.plugins.push(new webpack.ProgressPlugin(cfg.progressHandler));
|
|
102
102
|
}
|
|
103
|
+
|
|
104
|
+
const customizePath = path.join(cfg.cwd, 'hlx.webpack.customize.js');
|
|
105
|
+
if (await fse.pathExists(customizePath)) {
|
|
106
|
+
cfg.log.info(`--: Using custom webpack config from ${customizePath}`);
|
|
107
|
+
const customize = await import(customizePath);
|
|
108
|
+
if (customize.extraPlugins && typeof customize.extraPlugins === 'function') {
|
|
109
|
+
opts.plugins.push(...customize.extraPlugins(cfg, opts));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
103
112
|
return opts;
|
|
104
113
|
}
|
|
105
114
|
|