xshell 1.0.181 → 1.0.182

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 (3) hide show
  1. package/builder.js +1 -1
  2. package/package.json +1 -1
  3. package/server.js +1 -0
package/builder.js CHANGED
@@ -502,7 +502,7 @@ export class Bundler {
502
502
  " <meta charset='utf-8' />\n" +
503
503
  (heads ? heads.map(head => ` ${head}`).join_lines() : '') +
504
504
  (device_width ? " <meta name='viewport' content='width=device-width, initial-scale=1.0' />\n" : '') +
505
- (icon ? ` <link rel='icon' href='{root}${icon}' />\n` : '') +
505
+ (icon ? ` <link rel='icon' href='{root}${get(icon)}' />\n` : '') +
506
506
  (manifest ? ` <link rel='manifest' href='{root}${manifest}' />\n` : '') +
507
507
  this.resolve_dependency_files(_dependencies, false, { production: this.production }).map(fp => ` <script src='{root}vendors/${fp}' defer></script>`).join_lines() +
508
508
  (scripts?.before ? scripts.before.map(asset => ` <script src='{root}${get(asset)}' defer></script>`).join_lines() : '') +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.0.181",
3
+ "version": "1.0.182",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -626,6 +626,7 @@ export class Server {
626
626
  return fp;
627
627
  }
628
628
  if (assets_root) {
629
+ assert(fp.endsWith('.html'), '传入 assets_root 参数时 fp 应该为 .html 文件');
629
630
  response.body = (await fread(fp, { print: false }))
630
631
  .replaceAll('{root}', assets_root);
631
632
  return fp;