WIP: pass just filename param

pull/987/head
Pat Cavit 7 years ago
parent 9748e90e86
commit b4a80c5526

@ -60,7 +60,7 @@ async function replaceTagContents(source, type: 'script' | 'style', preprocessor
const processed: { code: string, map?: SourceMap | string } = await preprocessor({
content,
attributes,
options
filename : options.filename
});
if (processed && processed.code) {
@ -80,7 +80,7 @@ export async function preprocess(source: string, options: PreprocessOptions) {
if (!!markup) {
const processed: { code: string, map?: SourceMap | string } = await markup({
content: source,
options
filename: options.filename
});
source = processed.code;
}

@ -86,7 +86,7 @@ export interface PreprocessOptions {
markup?: (options: {content: string, options: PreprocessOptions}) => { code: string, map?: SourceMap | string };
style?: Preprocessor;
script?: Preprocessor;
id?: string
filename?: string
}
export type Preprocessor = (options: {content: string, attributes: Record<string, string | boolean>, options: PreprocessOptions}) => { code: string, map?: SourceMap | string };
export type Preprocessor = (options: {content: string, attributes: Record<string, string | boolean>, filename?: string}) => { code: string, map?: SourceMap | string };

Loading…
Cancel
Save