From f56a52a9212b55f7f6c170a1bd86f7f991dd77a6 Mon Sep 17 00:00:00 2001 From: Pat Cavit Date: Thu, 7 Dec 2017 10:32:39 -0800 Subject: [PATCH] WIP: pass just filename param --- src/index.ts | 4 ++-- src/interfaces.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index fb774a2fb7..1caf5b5abc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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; } diff --git a/src/interfaces.ts b/src/interfaces.ts index 51b45983ae..f2923c0788 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -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, options: PreprocessOptions}) => { code: string, map?: SourceMap | string }; +export type Preprocessor = (options: {content: string, attributes: Record, filename?: string}) => { code: string, map?: SourceMap | string };