@mzebley/mark-down 1.2.0 → 1.2.2
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/angular/index.d.ts +18 -0
- package/dist/angular/index.js +58 -0
- package/dist/angular/index.js.map +1 -0
- package/dist/browser.js +580 -0
- package/dist/browser.js.map +1 -0
- package/{src/snippet-client.ts → dist/chunk-35YHML5Z.js} +97 -174
- package/dist/chunk-35YHML5Z.js.map +1 -0
- package/dist/chunk-BRKEJJFQ.js +17 -0
- package/dist/chunk-BRKEJJFQ.js.map +1 -0
- package/dist/chunk-GWLMADTU.js +19 -0
- package/dist/chunk-GWLMADTU.js.map +1 -0
- package/{src/front-matter.ts → dist/chunk-MWZFQXNW.js} +48 -39
- package/dist/chunk-MWZFQXNW.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/inline.d.ts +8 -0
- package/{src/inline.ts → dist/inline.js} +19 -34
- package/dist/inline.js.map +1 -0
- package/dist/mark-down-inline.umd.js +8486 -0
- package/dist/mark-down-inline.umd.js.map +1 -0
- package/dist/slug.d.ts +3 -0
- package/dist/slug.js +8 -0
- package/dist/slug.js.map +1 -0
- package/dist/snippet-client-CiQX2Zcn.d.ts +63 -0
- package/package.json +12 -6
- package/src/angular/index.ts +0 -47
- package/src/browser.ts +0 -141
- package/src/errors.ts +0 -19
- package/src/index.ts +0 -5
- package/src/markdown.ts +0 -11
- package/src/slug.ts +0 -21
- package/src/types.ts +0 -49
- package/tsconfig.json +0 -7
- package/tsup.config.ts +0 -59
package/dist/slug.d.ts
ADDED
package/dist/slug.js
ADDED
package/dist/slug.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
interface SnippetMeta {
|
|
2
|
+
slug: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
order?: number;
|
|
6
|
+
tags?: string[];
|
|
7
|
+
path: string;
|
|
8
|
+
group?: string | null;
|
|
9
|
+
draft?: boolean;
|
|
10
|
+
extra?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
interface Snippet extends SnippetMeta {
|
|
13
|
+
html: string;
|
|
14
|
+
raw?: string;
|
|
15
|
+
markdown?: string;
|
|
16
|
+
}
|
|
17
|
+
interface SnippetSearchFilter {
|
|
18
|
+
type?: string;
|
|
19
|
+
group?: string;
|
|
20
|
+
tags?: string[];
|
|
21
|
+
tagsMode?: "any" | "all";
|
|
22
|
+
}
|
|
23
|
+
type ManifestSource = string | SnippetMeta[] | (() => Promise<SnippetMeta[]> | SnippetMeta[]);
|
|
24
|
+
interface ResponseLike {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
status: number;
|
|
27
|
+
text(): Promise<string>;
|
|
28
|
+
}
|
|
29
|
+
type SnippetFetcherResult = string | ResponseLike;
|
|
30
|
+
type SnippetFetcher = (url: string) => Promise<SnippetFetcherResult>;
|
|
31
|
+
interface SnippetClientOptions {
|
|
32
|
+
manifest: ManifestSource;
|
|
33
|
+
base?: string;
|
|
34
|
+
fetch?: SnippetFetcher;
|
|
35
|
+
frontMatter?: boolean;
|
|
36
|
+
cache?: boolean;
|
|
37
|
+
verbose?: boolean;
|
|
38
|
+
render?: (markdown: string) => string | Promise<string>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare class SnippetClient {
|
|
42
|
+
private readonly options;
|
|
43
|
+
private readonly manifestUrl?;
|
|
44
|
+
private readonly inferredBase?;
|
|
45
|
+
private manifestPromise?;
|
|
46
|
+
private readonly snippetCache;
|
|
47
|
+
constructor(options: SnippetClientOptions);
|
|
48
|
+
get(slug: string): Promise<Snippet>;
|
|
49
|
+
listAll(): Promise<SnippetMeta[]>;
|
|
50
|
+
listByGroup(group: string): Promise<SnippetMeta[]>;
|
|
51
|
+
listByType(type: string): Promise<SnippetMeta[]>;
|
|
52
|
+
search(filter: SnippetSearchFilter): Promise<SnippetMeta[]>;
|
|
53
|
+
getHtml(slug: string): Promise<string>;
|
|
54
|
+
invalidate(): void;
|
|
55
|
+
invalidateSlug(slug: string): void;
|
|
56
|
+
private loadManifest;
|
|
57
|
+
private resolveManifest;
|
|
58
|
+
private loadSnippet;
|
|
59
|
+
private fetchSnippet;
|
|
60
|
+
private resolveSnippetPath;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { type ManifestSource as M, type ResponseLike as R, type SnippetMeta as S, type Snippet as a, type SnippetSearchFilter as b, type SnippetFetcherResult as c, type SnippetFetcher as d, type SnippetClientOptions as e, SnippetClient as f };
|
package/package.json
CHANGED
|
@@ -1,32 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mzebley/mark-down",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "mark↓ core runtime and shared utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"files": ["dist"],
|
|
7
8
|
"publishConfig": {
|
|
8
9
|
"access": "public"
|
|
9
10
|
},
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/index.d.ts",
|
|
13
|
-
"import": "./dist/index.js"
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"default": "./dist/index.js"
|
|
14
16
|
},
|
|
15
17
|
"./slug": {
|
|
16
18
|
"types": "./dist/slug.d.ts",
|
|
17
|
-
"import": "./dist/slug.js"
|
|
19
|
+
"import": "./dist/slug.js",
|
|
20
|
+
"default": "./dist/slug.js"
|
|
18
21
|
},
|
|
19
22
|
"./browser": {
|
|
20
23
|
"types": "./dist/browser.d.ts",
|
|
21
|
-
"import": "./dist/browser.js"
|
|
24
|
+
"import": "./dist/browser.js",
|
|
25
|
+
"default": "./dist/browser.js"
|
|
22
26
|
},
|
|
23
27
|
"./inline": {
|
|
24
28
|
"types": "./dist/inline.d.ts",
|
|
25
|
-
"import": "./dist/inline.js"
|
|
29
|
+
"import": "./dist/inline.js",
|
|
30
|
+
"default": "./dist/inline.js"
|
|
26
31
|
},
|
|
27
32
|
"./angular": {
|
|
28
33
|
"types": "./dist/angular/index.d.ts",
|
|
29
|
-
"import": "./dist/angular/index.js"
|
|
34
|
+
"import": "./dist/angular/index.js",
|
|
35
|
+
"default": "./dist/angular/index.js"
|
|
30
36
|
}
|
|
31
37
|
},
|
|
32
38
|
"scripts": {
|
package/src/angular/index.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Inject, Injectable, InjectionToken, Provider } from "@angular/core";
|
|
2
|
-
import { from, map, Observable, shareReplay } from "rxjs";
|
|
3
|
-
import { SnippetClient } from "../snippet-client";
|
|
4
|
-
import type { Snippet, SnippetClientOptions, SnippetMeta } from "../types";
|
|
5
|
-
|
|
6
|
-
export const SNIPPET_CLIENT = new InjectionToken<SnippetClient>("@mzebley/mark-down/SNIPPET_CLIENT");
|
|
7
|
-
export const SNIPPET_CLIENT_OPTIONS = new InjectionToken<SnippetClientOptions>(
|
|
8
|
-
"@mzebley/mark-down/SNIPPET_CLIENT_OPTIONS"
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
export function provideSnippetClient(options: SnippetClientOptions): Provider[] {
|
|
12
|
-
return [
|
|
13
|
-
{ provide: SNIPPET_CLIENT_OPTIONS, useValue: options },
|
|
14
|
-
{
|
|
15
|
-
provide: SNIPPET_CLIENT,
|
|
16
|
-
useFactory: (opts: SnippetClientOptions) => new SnippetClient(opts),
|
|
17
|
-
deps: [SNIPPET_CLIENT_OPTIONS]
|
|
18
|
-
}
|
|
19
|
-
];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@Injectable({ providedIn: "root" })
|
|
23
|
-
export class MarkdownSnippetService {
|
|
24
|
-
constructor(@Inject(SNIPPET_CLIENT) private readonly client: SnippetClient) {}
|
|
25
|
-
|
|
26
|
-
get(slug: string): Observable<Snippet> {
|
|
27
|
-
return from(this.client.get(slug)).pipe(shareReplay({ bufferSize: 1, refCount: true }));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
listAll(): Observable<SnippetMeta[]> {
|
|
31
|
-
return from(this.client.listAll()).pipe(shareReplay({ bufferSize: 1, refCount: true }));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
listByGroup(group: string): Observable<SnippetMeta[]> {
|
|
35
|
-
return from(this.client.listByGroup(group)).pipe(shareReplay({ bufferSize: 1, refCount: true }));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
listByType(type: string): Observable<SnippetMeta[]> {
|
|
39
|
-
return from(this.client.listByType(type)).pipe(shareReplay({ bufferSize: 1, refCount: true }));
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
html(slug: string): Observable<string> {
|
|
43
|
-
return this.get(slug).pipe(map((snippet) => snippet.html));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type { Snippet, SnippetClientOptions, SnippetMeta } from "../types";
|
package/src/browser.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
installBufferShim();
|
|
2
|
-
|
|
3
|
-
export * from "./index";
|
|
4
|
-
|
|
5
|
-
function installBufferShim() {
|
|
6
|
-
const globalRef = globalThis as typeof globalThis & { Buffer?: BufferConstructor };
|
|
7
|
-
|
|
8
|
-
if (typeof globalRef.Buffer !== "undefined") {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const textEncoder = new TextEncoder();
|
|
13
|
-
const textDecoder = new TextDecoder();
|
|
14
|
-
|
|
15
|
-
class BrowserBuffer extends Uint8Array {
|
|
16
|
-
constructor(value: number | ArrayBufferLike | ArrayBufferView | ArrayLike<number>) {
|
|
17
|
-
if (typeof value === "number") {
|
|
18
|
-
super(value);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (isArrayBufferLike(value)) {
|
|
23
|
-
super(new Uint8Array(value));
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (ArrayBuffer.isView(value)) {
|
|
28
|
-
super(
|
|
29
|
-
new Uint8Array(value.buffer.slice(value.byteOffset, value.byteOffset + value.byteLength))
|
|
30
|
-
);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
super(Array.from(value));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
override toString(encoding: BufferEncoding = "utf-8") {
|
|
38
|
-
if (encoding !== "utf-8" && encoding !== "utf8") {
|
|
39
|
-
throw new Error(`Unsupported encoding '${encoding}' in browser Buffer shim`);
|
|
40
|
-
}
|
|
41
|
-
return textDecoder.decode(this);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const from = (value: string | ArrayLike<number> | BufferSource, encoding: BufferEncoding = "utf-8") => {
|
|
46
|
-
if (typeof value === "string") {
|
|
47
|
-
if (encoding !== "utf-8" && encoding !== "utf8") {
|
|
48
|
-
throw new Error(`Unsupported encoding '${encoding}' in browser Buffer shim`);
|
|
49
|
-
}
|
|
50
|
-
return new BrowserBuffer(textEncoder.encode(value));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (isArrayBufferLike(value)) {
|
|
54
|
-
return new BrowserBuffer(new Uint8Array(value));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (ArrayBuffer.isView(value)) {
|
|
58
|
-
return new BrowserBuffer(value);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (typeof (value as ArrayLike<number>).length === "number") {
|
|
62
|
-
return new BrowserBuffer(Array.from(value as ArrayLike<number>));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
throw new TypeError("Unsupported input passed to Buffer.from in browser shim");
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const alloc = (size: number, fill?: number | string) => {
|
|
69
|
-
if (size < 0) {
|
|
70
|
-
throw new RangeError("Invalid Buffer size");
|
|
71
|
-
}
|
|
72
|
-
const buffer = new BrowserBuffer(size);
|
|
73
|
-
if (typeof fill === "number") {
|
|
74
|
-
buffer.fill(fill);
|
|
75
|
-
} else if (typeof fill === "string") {
|
|
76
|
-
if (!fill.length) {
|
|
77
|
-
buffer.fill(0);
|
|
78
|
-
} else {
|
|
79
|
-
const pattern = textEncoder.encode(fill);
|
|
80
|
-
for (let i = 0; i < buffer.length; i++) {
|
|
81
|
-
buffer[i] = pattern[i % pattern.length];
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
} else {
|
|
85
|
-
buffer.fill(0);
|
|
86
|
-
}
|
|
87
|
-
return buffer;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const concat = (buffers: ArrayLike<Uint8Array>, totalLength?: number) => {
|
|
91
|
-
const sanitized = Array.from(buffers, (buffer) =>
|
|
92
|
-
buffer instanceof BrowserBuffer ? buffer : new BrowserBuffer(buffer)
|
|
93
|
-
);
|
|
94
|
-
const length = totalLength ?? sanitized.reduce((acc, current) => acc + current.length, 0);
|
|
95
|
-
const result = new BrowserBuffer(length);
|
|
96
|
-
let offset = 0;
|
|
97
|
-
for (const buffer of sanitized) {
|
|
98
|
-
result.set(buffer, offset);
|
|
99
|
-
offset += buffer.length;
|
|
100
|
-
}
|
|
101
|
-
return result;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const byteLength = (value: string | ArrayBuffer | ArrayBufferView) => {
|
|
105
|
-
if (typeof value === "string") {
|
|
106
|
-
return textEncoder.encode(value).length;
|
|
107
|
-
}
|
|
108
|
-
if (value instanceof ArrayBuffer) {
|
|
109
|
-
return value.byteLength;
|
|
110
|
-
}
|
|
111
|
-
if (ArrayBuffer.isView(value)) {
|
|
112
|
-
return value.byteLength;
|
|
113
|
-
}
|
|
114
|
-
throw new TypeError("Unable to determine byte length for provided value");
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
Object.defineProperties(BrowserBuffer, {
|
|
118
|
-
from: { value: from },
|
|
119
|
-
isBuffer: { value: (candidate: unknown) => candidate instanceof BrowserBuffer },
|
|
120
|
-
alloc: { value: alloc },
|
|
121
|
-
concat: { value: concat },
|
|
122
|
-
byteLength: { value: byteLength }
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
BrowserBuffer.prototype.valueOf = function valueOf() {
|
|
126
|
-
return this;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
globalRef.Buffer = BrowserBuffer as unknown as BufferConstructor;
|
|
130
|
-
|
|
131
|
-
if (typeof window !== "undefined" && typeof (window as typeof globalThis).Buffer === "undefined") {
|
|
132
|
-
(window as typeof globalThis & { Buffer?: BufferConstructor }).Buffer = globalRef.Buffer;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function isArrayBufferLike(value: unknown): value is ArrayBufferLike {
|
|
137
|
-
if (value instanceof ArrayBuffer) {
|
|
138
|
-
return true;
|
|
139
|
-
}
|
|
140
|
-
return typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer;
|
|
141
|
-
}
|
package/src/errors.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export class SnippetNotFoundError extends Error {
|
|
2
|
-
readonly slug: string;
|
|
3
|
-
|
|
4
|
-
constructor(slug: string) {
|
|
5
|
-
super(`Snippet with slug '${slug}' was not found in the manifest.`);
|
|
6
|
-
this.name = "SnippetNotFoundError";
|
|
7
|
-
this.slug = slug;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class ManifestLoadError extends Error {
|
|
12
|
-
readonly cause?: unknown;
|
|
13
|
-
|
|
14
|
-
constructor(message: string, cause?: unknown) {
|
|
15
|
-
super(message);
|
|
16
|
-
this.name = "ManifestLoadError";
|
|
17
|
-
this.cause = cause instanceof Error ? cause : cause ? new Error(String(cause)) : undefined;
|
|
18
|
-
}
|
|
19
|
-
}
|
package/src/index.ts
DELETED
package/src/markdown.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { marked } from "marked";
|
|
2
|
-
|
|
3
|
-
export function renderMarkdown(markdown: string): string {
|
|
4
|
-
const html = marked.parse(markdown);
|
|
5
|
-
|
|
6
|
-
if (typeof html === "string") {
|
|
7
|
-
return html;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
throw new Error("renderMarkdown unexpectedly returned a Promise");
|
|
11
|
-
}
|
package/src/slug.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const NON_ALPHANUMERIC = /[^a-z0-9]+/gi;
|
|
2
|
-
const LEADING_TRAILING_DASH = /^-+|-+$/g;
|
|
3
|
-
|
|
4
|
-
export function normalizeSlug(input: string): string {
|
|
5
|
-
const value = input?.trim();
|
|
6
|
-
if (!value) {
|
|
7
|
-
throw new Error("Cannot normalize an empty slug");
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const normalized = value
|
|
11
|
-
.toLowerCase()
|
|
12
|
-
.replace(NON_ALPHANUMERIC, "-")
|
|
13
|
-
.replace(/-{2,}/g, "-")
|
|
14
|
-
.replace(LEADING_TRAILING_DASH, "");
|
|
15
|
-
|
|
16
|
-
if (!normalized) {
|
|
17
|
-
throw new Error(`Slug '${input}' does not contain any alphanumeric characters`);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return normalized;
|
|
21
|
-
}
|
package/src/types.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export interface SnippetMeta {
|
|
2
|
-
slug: string;
|
|
3
|
-
title?: string;
|
|
4
|
-
type?: string;
|
|
5
|
-
order?: number;
|
|
6
|
-
tags?: string[];
|
|
7
|
-
path: string;
|
|
8
|
-
group?: string | null;
|
|
9
|
-
draft?: boolean;
|
|
10
|
-
extra?: Record<string, unknown>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface Snippet extends SnippetMeta {
|
|
14
|
-
html: string;
|
|
15
|
-
raw?: string;
|
|
16
|
-
markdown?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface SnippetSearchFilter {
|
|
20
|
-
type?: string;
|
|
21
|
-
group?: string;
|
|
22
|
-
tags?: string[];
|
|
23
|
-
tagsMode?: "any" | "all";
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type ManifestSource =
|
|
27
|
-
| string
|
|
28
|
-
| SnippetMeta[]
|
|
29
|
-
| (() => Promise<SnippetMeta[]> | SnippetMeta[]);
|
|
30
|
-
|
|
31
|
-
export interface ResponseLike {
|
|
32
|
-
ok: boolean;
|
|
33
|
-
status: number;
|
|
34
|
-
text(): Promise<string>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type SnippetFetcherResult = string | ResponseLike;
|
|
38
|
-
|
|
39
|
-
export type SnippetFetcher = (url: string) => Promise<SnippetFetcherResult>;
|
|
40
|
-
|
|
41
|
-
export interface SnippetClientOptions {
|
|
42
|
-
manifest: ManifestSource;
|
|
43
|
-
base?: string;
|
|
44
|
-
fetch?: SnippetFetcher;
|
|
45
|
-
frontMatter?: boolean;
|
|
46
|
-
cache?: boolean;
|
|
47
|
-
verbose?: boolean;
|
|
48
|
-
render?: (markdown: string) => string | Promise<string>;
|
|
49
|
-
}
|
package/tsconfig.json
DELETED
package/tsup.config.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsup";
|
|
2
|
-
|
|
3
|
-
export default defineConfig([
|
|
4
|
-
{
|
|
5
|
-
entry: {
|
|
6
|
-
index: "src/index.ts",
|
|
7
|
-
slug: "src/slug.ts",
|
|
8
|
-
inline: "src/inline.ts",
|
|
9
|
-
"angular/index": "src/angular/index.ts"
|
|
10
|
-
},
|
|
11
|
-
format: ["esm"],
|
|
12
|
-
dts: true,
|
|
13
|
-
sourcemap: true,
|
|
14
|
-
clean: true,
|
|
15
|
-
target: "es2020",
|
|
16
|
-
external: ["@angular/core", "@angular/common", "@angular/router", "@angular/platform-browser", "rxjs"],
|
|
17
|
-
outExtension() {
|
|
18
|
-
return {
|
|
19
|
-
js: ".js"
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
entry: {
|
|
25
|
-
browser: "src/browser.ts"
|
|
26
|
-
},
|
|
27
|
-
format: ["esm"],
|
|
28
|
-
dts: true,
|
|
29
|
-
sourcemap: true,
|
|
30
|
-
clean: false,
|
|
31
|
-
target: "es2020",
|
|
32
|
-
platform: "browser",
|
|
33
|
-
splitting: false,
|
|
34
|
-
outExtension() {
|
|
35
|
-
return {
|
|
36
|
-
js: ".js"
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
entry: {
|
|
42
|
-
"mark-down-inline": "src/inline.ts"
|
|
43
|
-
},
|
|
44
|
-
format: ["iife"],
|
|
45
|
-
globalName: "markDownInline",
|
|
46
|
-
dts: false,
|
|
47
|
-
sourcemap: true,
|
|
48
|
-
clean: false,
|
|
49
|
-
platform: "browser",
|
|
50
|
-
minify: false,
|
|
51
|
-
target: "es2018",
|
|
52
|
-
splitting: false,
|
|
53
|
-
outExtension() {
|
|
54
|
-
return {
|
|
55
|
-
js: ".umd.js"
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
]);
|