html-bundle 6.1.5 → 6.1.6

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/dist/utils.mjs CHANGED
@@ -25,8 +25,10 @@ export async function createDefaultServer(isSecure) {
25
25
  ? {
26
26
  http2: true,
27
27
  https: {
28
- key: bundleConfig.key,
29
- cert: bundleConfig.cert,
28
+ key: bundleConfig.key ||
29
+ (await readFile(path.join(process.cwd(), "localhost-key.pem"))),
30
+ cert: bundleConfig.cert ||
31
+ (await readFile(path.join(process.cwd(), "localhost.pem"))),
30
32
  },
31
33
  }
32
34
  : void 0);
@@ -78,8 +80,6 @@ async function getBundleConfig() {
78
80
  secure: false,
79
81
  handler: "",
80
82
  host: "::",
81
- key: await readFile(path.join(process.cwd(), "localhost-key.pem")),
82
- cert: await readFile(path.join(process.cwd(), "localhost.pem")),
83
83
  };
84
84
  try {
85
85
  const cfgPath = path.resolve(process.cwd(), "bundle.config.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-bundle",
3
- "version": "6.1.5",
3
+ "version": "6.1.6",
4
4
  "description": "A very simple bundler for HTML SFC",
5
5
  "bin": "./dist/bundle.mjs",
6
6
  "types": "./src/config.d.ts",
package/src/utils.mts CHANGED
@@ -44,8 +44,12 @@ export async function createDefaultServer(isSecure: boolean) {
44
44
  ? ({
45
45
  http2: true,
46
46
  https: {
47
- key: bundleConfig.key,
48
- cert: bundleConfig.cert,
47
+ key:
48
+ bundleConfig.key ||
49
+ (await readFile(path.join(process.cwd(), "localhost-key.pem"))),
50
+ cert:
51
+ bundleConfig.cert ||
52
+ (await readFile(path.join(process.cwd(), "localhost.pem"))),
49
53
  },
50
54
  } as FastifyServerOptions)
51
55
  : void 0
@@ -104,8 +108,6 @@ async function getBundleConfig(): Promise<Config> {
104
108
  secure: false,
105
109
  handler: "",
106
110
  host: "::",
107
- key: await readFile(path.join(process.cwd(), "localhost-key.pem")),
108
- cert: await readFile(path.join(process.cwd(), "localhost.pem")),
109
111
  };
110
112
 
111
113
  try {