@forsakringskassan/docs-generator 2.21.0 → 2.21.1

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/index.d.ts CHANGED
@@ -222,6 +222,7 @@ declare class Generator_2 {
222
222
  private markdownOptions;
223
223
  constructor(options: GeneratorOptions);
224
224
  compileScript(name: string, src: string | URL, options?: Partial<CompileOptions>, buildOptions?: {
225
+ format?: "iife" | "cjs" | "esm";
225
226
  define?: Record<string, string>;
226
227
  }): void;
227
228
  compileStyle(name: string, src: string | URL, options?: Partial<CompileOptions>): void;
@@ -565,6 +566,7 @@ export declare interface ProcessorRuntime {
565
566
  name?: string;
566
567
  /** Build options (passed to compileScript) */
567
568
  buildOptions?: {
569
+ format?: "iife" | "cjs" | "esm";
568
570
  define?: Record<string, string>;
569
571
  };
570
572
  }
package/dist/index.js CHANGED
@@ -1595,6 +1595,7 @@ async function compileStyle(assetFolder, name, src, options) {
1595
1595
  filename,
1596
1596
  publicPath: `./assets/${filename}`,
1597
1597
  integrity,
1598
+ format: "stylesheet",
1598
1599
  size: stat.size,
1599
1600
  type: "css"
1600
1601
  };
@@ -1670,11 +1671,12 @@ async function compileScript(options) {
1670
1671
  const entryPoints = [src instanceof URL ? node_url.fileURLToPath(src) : src];
1671
1672
  const outfile = path$1.join("temp", `asset-${name}.js`);
1672
1673
  const external = [...assets, ...vendor.map(toExternalVendor)];
1674
+ const format = buildOptions.format ?? "esm";
1673
1675
  await esbuild({
1674
1676
  entryPoints,
1675
1677
  outfile,
1676
1678
  bundle: true,
1677
- format: "esm",
1679
+ format,
1678
1680
  platform: "browser",
1679
1681
  external,
1680
1682
  tsconfig: path$1.join(__dirname, "../tsconfig-examples.json"),
@@ -1697,6 +1699,7 @@ async function compileScript(options) {
1697
1699
  filename,
1698
1700
  publicPath: `./assets/${filename}`,
1699
1701
  integrity,
1702
+ format,
1700
1703
  size: stat.size,
1701
1704
  type: "js"
1702
1705
  };
@@ -2842,10 +2845,17 @@ class Generator {
2842
2845
  this.sourceFiles = [];
2843
2846
  this.markdownOptions = options.markdown;
2844
2847
  const bootstrapUrl = new URL("runtime-bootstrap.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)));
2845
- this.compileScript("bootstrap", bootstrapUrl, {
2846
- appendTo: "head",
2847
- priority: 100
2848
- });
2848
+ this.compileScript(
2849
+ "bootstrap",
2850
+ bootstrapUrl,
2851
+ {
2852
+ appendTo: "head",
2853
+ priority: 100
2854
+ },
2855
+ {
2856
+ format: "iife"
2857
+ }
2858
+ );
2849
2859
  }
2850
2860
  compileScript(name, src, options, buildOptions) {
2851
2861
  this.scripts.push({